Linux mysql porting settings method

  

Environment:

db01:10.10.10.101

db03:10.10.10.103

Requirements:

will db01 Complete migration on mysql, migrate to db03

Detailed steps:

1. Package db01 on /app directory and scp to db03: #tar -cvzf mysql.tar.gz /app/;scp mysql.tar.gz 10.10.10.103:/root/2. ​​copy db01 on /etc/ld.so.conf.d/mysql.conf to the corresponding directory of db03, ie /etc/ld.so.conf.d /#scp /etc/ld.so.conf.d/mysql.conf 10.10.10.103:/etc/ld.so.conf.d/3. Unzip mysql.tar.gz in the root directory of db03: cd /;tar -xvf /root/mysql.tar.gz4. Modify the /app/conf/mysql/my.cnf configuration file on db03 (here the main logout slave configuration to start mysql normally)#*** slave ***#master -host = 10.10.10.101#master-USER = slave_user#master-password = 123456#master-port = 3306#replicate-ignore-db=mysql,test#replicate-do-db = <dataname>#relay-LOG = relay-LOG#log-slave-updatesserver-id = 3 ##Modify values ​​other than other server ids 5. Create a new directory based on the /app/conf/mysql/my.cnf configuration file: #mkdir -p /log/Mysql//data/my Sql#mysql_install_db --datadir=/data/mysql/#chown mysql:mysql /log/mysql//data/mysql/-R#mysql_install_db --datadir=/data/mysql/

#mysql_install_db -- Datadir=/data/mysql/6. Add mysql to the boot line and check: ln -s /app/init.d/mysql /etc/init.d/mysql;chkconfig mysql on# chkconfig --list |  Grep mysqlmysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off7. Add mysql to the PATH environment variable and make it effective: #vi /root/.bash_profilePATH=$PATH:$HOME/bin :/app/mysql/SHARE/mysql:/app/mysql/bin# source /root/.bash_profile8. For security reasons, manually load the lib library: #ldconfig9. Test mysql to see if it can start normally #mysql

- - If there is an unexpected error in the migration process, please check the error message according to /var/log/messages /log/mysql/mysqld.log

Copyright © Windows knowledge All Rights Reserved