I've looked everywhere an cannot seem to find a fix for this issue, despite tons of articles on it. Anyway, I'm attempting the following command
mysqldump -hlocalhost -uroot -p mydb mytable > myexportedtable.sql
This will occasionally result in the following error
mysqldump: Got error: 1045: Access denied for user 'ODBC'@'localhost' <using password:NO> when trying to connect
This is baffling for two reasons. One - I am specifying a root user in my command however it assumes I'm ODBC. Two - I only get this error occasionally. (more often than not). I am able to authenticate to the mysql interactive shell when specifying root but keep getting this error with mySQL dump. Any insight is greatly appreciated as I've been trouble shooting this for days now.
Type in the command manually. Sometimes copying and pasting the command changes the hyphen character (-). It is ignoring the username because it literally doesn't recognize a -u.
I recently had the error too.
mysql --user=jake
ERROR 1045 (28000): Access denied for user 'jake'@'localhost' (using password: NO)
This seems to happens when you connect with the wrong user to the database, wrong password usage or when you connect from the wrong host or over the socket/port when you are not allowed to.
I suggest to check the access priviledges of the user like:
mysql> SELECT user, host FROM mysql.user WHERE user = 'jake';
mysql> SHOW GRANTS FOR 'jake'@'localhost';
Perhaps also take a look at mysqlimport: Error: 1045, Access denied , which helped me a lot.
regards,
Jake
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With