By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

MySQL 1045 Authentication error

P: 4
I have very strange error

mysqldump: Got error: 1045: Access denied for user '[root]'@'localhost' (using p
assword: YES) when trying to connect

I have installed mysql freshly with blank password for user "root" when I am trying perform backup with mysqldump I am getting the strange error

I am trying with the folowing command

d:\xampp\mysql\bin\mysqldump -u [root] -p []

mysqldump: Got error: 1045: Access denied for user '[root]'@'localhost' (using p
assword: YES) when trying to connect

Any one please help me
Oct 26 '09 #1

✓ answered by mwasif

samalphins,

In the first post you said that root does not have any password but in the command you are providing the password.

Are you connecting to MySQL remotely? In order to do so, you must give the permissions to root to connect remotely. If you are on the same system where you have installed MySQL then do not use host parameter, try the following command

Expand|Select|Wrap|Line Numbers
  1. D:\>xampp\mysql\bin\mysqldump -uroot -p db_name > dump.sql

Share this Question
Share on Google+
7 Replies


code green
Expert 100+
P: 1,726
Try with host
Expand|Select|Wrap|Line Numbers
  1. -u [root] -h host -p []
mysqldump is problematic and fairly buggy I have noticed.
I also use the full path to the backup file as well as mysqldump.exe.
If you do use a password there should be no space between -p and the password.
I also suffix with 2>&1 but I can't remember why
Oct 26 '09 #2

P: 4
Dear green thanks for the reply

I tried with host but I am getting new error as below.

D:\>xampp\mysql\bin\mysqldump -u [root] -h 192.168.0.251 -p []
Enter password: *********
mysqldump: Got error: 2003: Can't connect to MySQL server on '192.168.0.251' (10060) when trying to connect

Any other please.
Oct 27 '09 #3

P: 4
Dear green thanks for the reply

I tried with host but I am getting new error as below.

D:\>xampp\mysql\bin\mysqldump -u [root] -h 192.168.0.251 -p []
Enter password: *********
mysqldump: Got error: 2003: Can't connect to MySQL server on '192.168.0.251' (10060) when trying to connect

I uninstalled Norton internet security and disabled windows firewall even then i am facing the same issue

Any other suggestion please.
Oct 27 '09 #4

code green
Expert 100+
P: 1,726
Can you actually connect to this database outside of mysqldump?
It looks like a permissions problem.

I think user of mysqldump needs all permissions granted to work.
Read alone is not enough
Oct 27 '09 #5

mwasif
Expert 100+
P: 801
samalphins,

In the first post you said that root does not have any password but in the command you are providing the password.

Are you connecting to MySQL remotely? In order to do so, you must give the permissions to root to connect remotely. If you are on the same system where you have installed MySQL then do not use host parameter, try the following command

Expand|Select|Wrap|Line Numbers
  1. D:\>xampp\mysql\bin\mysqldump -uroot -p db_name > dump.sql
Oct 28 '09 #6

P: 4
Dear M W Asif,

It worked for me great help I got from you. Thanks for the support and reply.
Oct 28 '09 #7

mwasif
Expert 100+
P: 801
You are welcome samalphins.

I am just M Wasif not M W Asif -:)
Nov 1 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.