how to get DB backup script from Remote Server in MySQL using command-line utility?

7.1k views Asked by At

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
1

There are 1 answers

2
geon On BEST ANSWER

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