Written in the front: recently started with the Ubuntu system, there is no good MySQL interface program, so .... Can only use the terminal operation of the.
Operation Process: Open "terminal", directly enter the following content, click to return
That's a word, oh!
Purpose: Copy the database of the remote server to the local.
Java code
Copy Code code as follows:
Mysqldump-h ' 114.212.111.123 '-urose-pxxxooo--opt--compress ITSM--skip-lock-tables | Mysql-h Localhost-uroot-proot ITSMC
Gerry 1: Look at the bottom of the unknown *******************************
Explain:
114.212.111.123 Remote server name
ROSE Remote Database login name
XXXOOO Remote Database login password
ITSM Remote Database name (that is, the source of the replication)
localhost Local database name (this is typically the case)
Root Local Database login name (This is typically the case)
Root Local Database login password (This is usually the case)
ITSMC local (that is, the purpose of replication)
SQL Explanation:
Mysqldump is a MySQL-specific command for copy operations.
The meaning of the--opt operation
--compress compress the data to be transferred
--skip-lock ignores locked tables (plus this prevents an error when the table has a foreign key)
-tables all tables in a database
-H Server Name
-u username (* No space after, directly add user name)
-p Password (* No space behind, direct password)
Attention:
-U,-P with no space, directly add username and password!!!
Gerry 2:none of your business************************
This morning, my ears echoed the melody of a song "Long time No See" ...