0

When i am running mysqldump with user(lets say test) i am getting error message:

mysqldump: Got error: 1045: Access denied for user 'test'@'localhost' (using password: YES) when trying to connect

Although the database and user details are correct as i am able to login. Also when i use mysqldump without passing -p then it works fine and ask for user password.

mysqldump  -u test -p dbtest > dbtest.sql
Enter password:

I tried to pass --port, -h 127.0.0.1 as mentioned in other threads but nothing works.

  • does the user `test` have `LOCK_TABLES` grant? [More here](http://stackoverflow.com/questions/8658996/minimum-grants-needed-by-mysqldump-for-dumping-a-full-schema-triggers-are-miss) – TJ- Aug 26 '14 at 13:13
  • It is granted all the privileges, if i am not wrong "grant privileges" will include lock_tables ?? – user3933150 Aug 26 '14 at 13:20
  • Can you show the permissions that the test user has? Are you trying to create the `mysqldump` from somewhere other than the machine where mysql server is running [Note : `localhost`]? – TJ- Aug 27 '14 at 07:25
  • I am dumping the database on my own server. It has below permissions, it that what you mean ? | GRANT USAGE ON *.* TO 'test'@'%' IDENTIFIED BY PASSWORD '1234'| | GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'%' +------------------------------------------------------------------- – user3933150 Aug 27 '14 at 07:48
  • Check [this](http://stackoverflow.com/questions/2126225/why-is-a-grant-usage-created-the-first-time-i-grant-a-user-privileges) - It will tell you why grant usage is not enough but you need to `GRANT ALL PRIVILEGES ON database.* TO test` to grant all privileges to the user – TJ- Aug 27 '14 at 07:54
  • I granted all privileges to user "test" but still facing the same issue. What else do i need to check for? – user3933150 Aug 28 '14 at 08:23
  • I'm not sure then. This might help : http://www.tikalk.com/alm/solution-mysql-error-1045-access-denied-userlocalhost-breaks-openstack – TJ- Aug 28 '14 at 08:41

0 Answers0