MySQL Data migration

Source: Internet
Author: User

The database to be migrated is as follows:

Mysql>show databases;+--------------------+| Database           |+--------------------+|Information_schema||Forbk||Hive||Mysql||Test|+--------------------+5Rowsinch Set(0.00sec) MySQL>  UseFORBKDatabaseChangedmysql> Create Table' Back_table ' (xintYint); Query OK,0Rows Affected (0.01sec) MySQL> Insert  intoBack_tableValues( A, -); Query OK,1Row affected (0.00sec) MySQL> Select *  fromback_table;+------+------+|X|Y|+------+------+|    A |    - |+------+------+1Rowinch Set(0.00sec) MySQL>

To migrate the database configuration as follows, you can find the MySQL data file stored in: Datadir=/var/lib/mysql

[Mysqld]datadir=/var/lib/Mysqlsocket=/var/lib/mysql/Mysql.sockuser=Mysqlcharacter_set_server=Utf8init_connect='SET NAMES UTF8'# Disabling Symbolic-links are recommended to prevent assorted security riskssymbolic-links=0[Mysqld_safe]log-error=/var/log/Mysqld.logpid-file=/var/run/mysqld/Mysqld.pid[mysql]default-character-set=Utf8#bin-Long=justin-bin "/etc/my.cnf" 16L, 364C

Now migrate the Forbak library of this database to another machine:

Copy the/var/lib/mysql/forbk file directly to the DataDir directory of another machine,

Without restarting the MySQL service, you can dynamically see that the FORBK Library has been successfully migrated to the target machine:

Note: Backing up the database by copying files is not documented in Binlog. However, when the backup is completed, the Update,insert and delete operations of the backed up libraries will trigger binlog;

MySQL Data migration

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.