Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

mysqldump access denied

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) when trying to connect

However, I can access mysql using the same user and password.

mysql --user=test -p[password]

Current user: [email protected]

SSL: Not in use

Current pager: stdout

Using outfile: ''

Using delimiter: ;

Server version: 5.0.91-50-log Percona SQL Server, Revision 73 (GPL)

Protocol version: 10

Connection: 10.64.1.2 via TCP/IP

Updates:

If I do following mysql document: --password[=password] or -p[password].

Since my password contains special symbol @, Mysql cannot detect user correctly. It complains:

mysqldump: Got error: 1044: Access denied for user 'test'@'%' to database

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have to run CMD.EXE as the Administrator:

Right click on cmd.exe --> Run as Administrator and then type your command:

mysqldump -u[username] -p[password] -h[ip or name] yourdatabasename > c:sqlfile.sql

It should work fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...