Preface: I recently started to use the Ubuntu system. There is really no good mysql interface program, so I can only operate it on a terminal.
Procedure: open terminal, enter the following content, and press Enter.
That's all!
Purpose: copy the database of the remote server to a local device.
Java code
Copy codeThe Code is as follows:
Mysqldump-h '2017. 212.111.123 '-uROSE-pxxxooo -- opt -- compress ITSM -- skip-lock-tables | mysql-h localhost-uroot-proot ITSMC
* ********************* Gejige 1: if you do not know the truth, see the following *******************************
Explanation:
114.212.111.123 remote server name
ROSE remote database Login Name
Xxxooo remote database logon Password
ITSM remote database name (that is, the source of the copy)
Localhost local database name (usually this is the name)
Root local database Login Name (this is usually the case)
Root local database logon password (this is usually the case)
ITSMC local (that is, the purpose of replication)
SQL explanation:
Mysqldump is a mysql Command Used for copy operations.
-- Meaning of opt operation
-- Compress: compresses the data to be transmitted
-- Skip-lock: Ignore the locked table (this clause can prevent an error when the table has a foreign key)
-Tables: all tables in a database
-H server name
-U User Name (* without spaces, add the user name directly)
-P password (* the password is directly added without spaces)
Note:
-U and-p are not followed by spaces. directly add the user name and password !!!
: None of your business ************************
This morning, the music of a song [not seeing you for a long time ]......