mysqldump Error 1045 Access denied despite correct passwords etc

后端 未结 28 1164
执笔经年
执笔经年 2021-01-30 12:56

This is a tricky one, I have the following output:

mysqldump: Got error: 1045: Access denied for user \'root\'@\'localhost\' (using password: YES) when tr

相关标签:
28条回答
  • 2021-01-30 13:11

    For me it worked when I omitted the password.

    So mysqldump -u user dbname > dump.sql

    0 讨论(0)
  • 2021-01-30 13:12

    I had the same error for last 2 days. Tried bunch of things. Nothing worked.
    But this did work:
    Create another user. Grant it everything.
    mysqldump -u new_user db_name > db_name.sql //no error

    0 讨论(0)
  • 2021-01-30 13:12

    I was having the same issue, for 30min! I found that I was using _p instead of -p, the terminal font confused me!

    0 讨论(0)
  • 2021-01-30 13:14

    This solution might be one of the last to try/least likely to be the culprit, but this was my problem...

    My problem was that the directory I was trying to dump to needed admin privileges to write to and that's what was causing the mysqldump command to return "Access Denied".

    I set the dump file path to my desktop dir and then it worked.

    This was on Windows.

    0 讨论(0)
  • 2021-01-30 13:14

    Go to Start-> All Programs -> Accessories right click on Command Prompt click on Run as administrator

    In the command prompt using CD command Go to MySQL bin folder and run the below command

    mysqldump --user root --password=root --all-databases>dumps.sql

    it will create dumps.sql file in the bin folder itself.

    0 讨论(0)
  • 2021-01-30 13:15

    In Past same problem occurred to me after I copied the mysqldump statement from a MS Word file.

    But When typing the statement directly, everything worked fine.

    In hex editor the "-" of the not working statement was represented by the unicode char e2 80 93 (http://www.fileformat.info/info/unicode/char/2013/index.htm)

    In sort, type password directly and check the copy paste code as the uni-code (or other encoding) strings might cause an issue..

    0 讨论(0)
提交回复
热议问题