How to get backup script database from remote server in MySQL using command line utility?

Can someone tell me how to get a backup of a script database from a remote server in MySQL using the command line?

I use the command as follows, but not working:

C:\>mysqldump -h <server ip> -u <user-id> -p <password> <db name> > E:\dumpfilename.sql 
+4
source share
1 answer

Password syntax is invalid. You need to write the password immediately after -p without a space. Therefore, the password is interpreted as the database name.

Instead, write:

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

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

+5
source

Source: https://habr.com/ru/post/1415522/


All Articles