Reputation: 10122
i am using mysql workbench which has the command mysqldbcopy
under linux. 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 \
--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
Upvotes: 2
Views: 3122
Reputation: 41
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.
Upvotes: 4
Reputation: 5063
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 '='.
Try with single quotes if double quotes doesn't help.
Verify if the port 3310 is correct. Default I guess when you install is 3306. Can you confirm?
Upvotes: 1