[英]mysqldbcopy - Error 1045: Access denied for user 'root'@'localhost' (using password: NO)
i am using mysql workbench which has the command mysqldbcopy
under linux. 我正在使用在Linux下具有命令
mysqldbcopy
mysql工作台。 when i am trying to use it, i have to supply a connection string (see the examples here ). 当我尝试使用它时,我必须提供一个连接字符串(请参见此处的示例)。
my password contains ampersand (&), thus i am invoking mysqldbcopy
as follows (for character escaping propose) 我的密码包含“&”号,因此我按如下方式调用
mysqldbcopy
(用于字符转义建议)
mysqldbcopy \
--source "root:&1qqq34rtyy@localhost:3310:/var/run/mysqld/mysqld.sock" \
--destination "root:&1qqq34rtyy@localhost:3310:/var/run/mysqld/mysqld.sock" \
old:new
but i receive the following error, which by googling, i found that it means that i do not supply the right password (correct me if i am wrong) 但是我收到以下错误,通过谷歌搜索,我发现这意味着我没有提供正确的密码(如果我输入错了,请更正我)
# Source on localhost: ... ERROR: Cannot connect to the Source server.
Error 1045: Access denied for user 'root'@'localhost' (using password: NO)
could one please shed the light of where is the problem? 能否请您阐明问题出在哪里?
and yes, i am sure that the password is correct, it has been copied from .my.cnf
, and i am able to use it under mysql
command 是的,我确定密码是正确的,它是从
.my.cnf
复制而来的,我可以在mysql
命令下使用它
mysqldbcopy mysqldbcopy
--source=root':&1qqq34rtyy'@localhost:3310:/var/run/mysqld/mysqld.sock
--destination=root':&1qqq34rtyy'@localhost:3310:/var/run/mysqld/mysqld.sock
old:new --force
I have also faced same issue, 我也遇到过同样的问题
The above mentioned syntax executes smoothly without any error. 上面提到的语法可以顺利执行,没有任何错误。 Use
--force
, if the destination database name already exists & needs to overwrite forcefully. 如果目标数据库名称已经存在并且需要强制覆盖 ,请使用
--force
。
By looking at the link you provided, I can conclude this - 通过查看您提供的链接,我可以得出以下结论:
You are using - 您正在使用 -
mysqldbcopy \
--source "root:&1qqq34rtyy@localhost:3310:/var/run/mysqld/mysqld.sock" \
--destination "root:&1qqq34rtyy@localhost:3310:/var/run/mysqld/mysqld.sock" \
old:new
But the link shows, 但链接显示,
mysqldbcopy \
--source=root:pass@localhost:3310:/test123/mysql.sock \
--destination=root:pass@localhost:3310:/test123/mysql.sock \
util_test:util_test_copy
Conclusions, 结论,
After --source
and --destination
, the example in the link you provided have '=' . 在
--source
和--destination
,您提供的链接中的示例带有'=' 。
Try with single quotes if double quotes doesn't help. 如果双引号没有帮助,请尝试使用单引号。
Verify if the port 3310 is correct. 验证端口3310是否正确。 Default I guess when you install is 3306. Can you confirm?
默认值是3306。安装时可以确认吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.