Mysql remote database import to local database
Mysqldump-h '2017. 212.111.123 '-uROSE-pxxxooo -- opt -- compress ITSM -- skip-lock-tables | mysql-h localhost-uroot-proot ITSMC
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 !!!