0

Trying to run mysqldump I get error 1045: Access denied for user 'root'@'localhost' (using password NO) when trying to connect. This is after doing a sudo su before the mysqldump command. I get the same thing if I don't do the sudo su and try it as a normal user, In this case is is 'user'@'localhost' instead of 'root'@'localhost'. I don't have a .my.cnf file anywhere on the system, don't know the format of one, so I can't create one as suggested in a previous post.

2 Answers 2

3

Access denied for user 'root'@'localhost' (using password NO)

You did not provide a password. I would assume you need one.

mysqldump -u {user} -p {database} > {export.sql}

where you will get asked for your password. And are you sure it is root? You admin user would be my username for mysql ;)

0

I have never seen mysqldump presented with having the options for user and password so I never tried using them with the command. That is exactly why I was getting the 1045 errors no matter how I tried. Adding the -u and -p options solved my problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .