Summary of database migration

Source: Internet
Author: User

Summary of database migration requirements: migrate data from database database1 on the remote server IP Address: 172.10.10.1 to the database database2 table on the server IP Address: 172.10.10.2, the required field must correspond to 1. log on to the remote server locally and download data.

Remotely log on to the server ssh 172.10.10.1 and view the mysql process ps-ef | grep mysql on this server. // one server may have multiple mysql processes, the port and sock file are used to distinguish the mysql server/home/work/oem/mysql_oem/bin/mysql-h localhost-uroot-P 3307 -- socket =/home /work/oem/mysql_oem/mysql. sock checks the encoding format of data on mysql Server 3307. show variables like 'character % '; view the database show databases on mysql Server 3307 and dump the data on the mysql server with port 3307 according to latin1 encoding/home/work/oem/mysql_oem/bin/mysqldump -- de Fault-character-set = latin1-h localhost-uroot-P 3307 -- socket =/home/work/oem/mysql_oem/mysql. sock database1> ~ /Oem/redmine_oem/public/database1. SQL

 

Similarly, the database database2 table in 172.10.10.2 is migrated locally.
Download database1. SQL to the local wget url and create the database create schema database1 locally. Import the data to the local database database1. mysql-uroot-p ***-hlocalhost database1 

 

According to requirements, corresponding fields are matched
A) Insert ...... select ..... from .. b) update ..... set .... where... c) substring (string, pos) The substring d from the pos position of string) concat (string1, string2): connect string1 to string2

 

3. If the local migration is successful, go online a) back up the online system B) view the target database c) Perform a series of local operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.