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
Unknown Coder
  • 1,510
  • 2
  • 28
  • 56

1 Answers1

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".

geon
  • 8,128
  • 3
  • 34
  • 41
  • I tried as follows `C:\>mysqldump -h 111.111.111.111 -u userid -pMyPassword DBname > E:\dumpfilename.sql` but not working – Unknown Coder Jun 01 '12 at 09:40
  • Again, what is your error message? Just stating that it isn't working isn't helpful. – geon Jun 01 '12 at 10:26