4

Can anybody tell me that how to get DB backup script from Remote Server in MySQL using command-line utility?

I'm using a command as follows, but not working:

C:\>mysqldump -h <server ip> -u <user-id> -p <password> <db name> >
 E:\dumpfilename.sql
5
  • what do you mean under "DB backup script"? Db dump? Commented Jun 1, 2012 at 7:53
  • 1
    What is the error you're getting? Commented Jun 1, 2012 at 7:54
  • @JeffreyVandenborne mysqldump: Got error: 1044: Access denied for user '<user-id>'@'%' to database '<password>' when selecting the database Commented Jun 1, 2012 at 7:57
  • Do you mean to take dump for entire database or a particular table? Commented Jun 1, 2012 at 7:59
  • @ShreekumarS, edited my post. Take a look now. Commented Jun 1, 2012 at 9:58

1 Answer 1

5

The syntax for the password is wrong. You need to write the password immediately after the -p, without a space. That's why the password is interpreted as the database name.

Write this instead:

C:\>mysqldump -h <server ip> -u <user-id> -p<password> <db name> >
 E:\dumpfilename.sql

Notice how there is no space after -p. An example would be -phunter2, where the password is "hunter2".

Sign up to request clarification or add additional context in comments.

2 Comments

I tried as follows C:\>mysqldump -h 111.111.111.111 -u userid -pMyPassword DBname > E:\dumpfilename.sql but not working
Again, what is your error message? Just stating that it isn't working isn't helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.