当我尝试使用ssh中的mysqldump进行备份时, 我在计算机10.64.1.1上运行以下命令.它给出了以下错误.
When I try to backup using mysqldump from ssh, I run the following command on machine 10.64.1.1. It gives the following error.
mysqldump --user=test -p=password --host=10.64.1.2 --tab=. databasename tablename
mysqldump: Got error: 1045: Access denied for user 'test'@'10.64.1.1' (using password: YES)尝试连接时
但是,我可以使用相同的用户名和密码访问mysql.
However, I can access mysql using the same user and password.
mysql --user=test -p[password]
当前用户:test@10.64.1.1
SSL:Not in use
当前寻呼机:stdout
使用外档文件:''
使用定界符:;
服务器版本:5.0.91-50-log Percona SQL Server, Revision 73 (GPL)
协议版本:10
连接:10.64.1.2 via TCP/IP
更新:
如果我遵循以下mysql文档:--password[=password]或-p[password].
If I do following mysql document: --password[=password] or -p[password].
由于我的密码包含特殊符号@,因此Mysql无法正确检测到用户.它抱怨:
Since my password contains special symbol @, Mysql cannot detect user correctly. It complains:
mysqldump: Got error: 1044: Access denied for user 'test'@'%' to database
推荐答案我认为您在使用-p或使用--password时必须丢失= =
I think that you would have to lose the = when using -p or do it with --password :
-密码[=密码],-p [密码]
--password[=password], -p[password]
连接到时使用的密码 服务器.如果你用短 选项表(-p),则不能有 选项和选项之间的空间 密码.如果您省略密码 --password或-p之后的值 命令行上的选项,您是 提示输入一个.指定一个 命令行上的密码应为 被认为是不安全的.参见第6.6节, 保持密码安全".
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访问被拒绝
发布评论