Yesterday afternoon to help carp to a large group purchase site Transfer Database server, this article should have been transferred yesterday after the summary issued, but for some reason did not write in time, now quickly fill up.
First of all, the environment is like this, the old database server MySQL version 5.0 centos system no Web, no FTP, new database server mysql5.1 CentOS nginx.
See this environment first idea is through phpMyAdmin import export, but the original database server has no web environment, the other database files about 300M, only rely on phpMyAdmin cannot import.
Down ready to stop MySQL, pack the database directory, and then overwrite the new server in the database directory, but the carp tried to say the copy used to have a problem with the table, so this method also give up.
Finally go to the old server to use the command
Copy Code code as follows:
Mysqldump-u user name-p database name > database name. sql
Export to a. sql file, and then zip-compress, transfer to the new database server via another server SSH (SCP), and import through the following statement (this can use the Mysqldump-u user name-p database name < database name. SQL but want to see execution progress, So the following actions are performed)
Copy Code code as follows:
Mysql-u root-p
Mysql>use Database
Mysql>source/data0/tuan/tuan.sql
So import SSH entry will be a lot of, recommend looking for Windows Server hanging ssh to execute, I use the company network bandwidth run full 4M, occupy my full speed.
So far the database transfer has let me nagging, not too many technical things, just to their own record, to avoid forgetting, warm so know new.