mysqldump Error 1045 Access denied despite correct passwords etc

后端 未结 28 1166
执笔经年
执笔经年 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:05

    I just ran into this after a fresh install of MySQL 5.6.16.

    Oddly, it works without the password specified or flagged:

    mysqldump -u root myschema mytable > dump.sql

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

    In my case, I could access correctly with mysql.exe but not with mysqldump.exe.

    The problem was the port for my connection was not the default one (3306) and I had to put the mysqldump port work with (-P3307)

    mysqldump -u root -p -P3307 my_database > /path/backup_database

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

    Putting -p as the first option worked for me on Windows Server 2012R2 (in cmd.exe as Admin).

    mysqldump.exe –p --user=root  --databases DBname --result-file=C:\DBname.sql
    
    0 讨论(0)
  • 2021-01-30 13:09

    Mysql replies with Access Denied with correct credentials when the mysql account has REQUIRE SSL on

    The ssl_ca file (at a minimum) had to be provided in the connection paramiters.

    Additional ssl parameters might be required and are documented here: http://dev.mysql.com/doc/refman/5.7/en/secure-connection-options.html


    Also posted here https://stackoverflow.com/a/39626932/1695680

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

    You need to put backslashes in your password that contain shell metacharacters, such as !#'"`&;

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

    This worked for me

    mysqldump -u root -p mydbscheme > mydbscheme_dump.sql
    

    after issuing the command it asks for a password:

    Enter password:
    

    entering the password will make the dump file.

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