mysqldump 即使在命令行选项中告诉它密码后仍要求输入密码

mysqldump 即使在命令行选项中告诉它密码后仍要求输入密码

我正在使用以下命令:

mysqldump -alv -h 123.123.123.123 --password=P@ssw0rd --user=UsernameHere --add-drop-table -p DatabaseSchemaName > dump.sql

然后它要求我输入密码。我在命令中指定密码时做错了吗?

我输入的密码肯定是正确的密码。

答案1

mysqldump 命令:

--password[=password], -p[password]

The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.
Specifying a password on the command line should be considered insecure. See Section 6.6, "Keeping Your Password Secure".

您有两个密码参数:

mysqldump -alv -h 123.123.123.123- 密码=P@ssw0rd --user=用户名在这里 --add-drop-table-p数据库架构名称 > dump.sql

删除最后一个参数它就应该正常工作。

相关内容