一、导出老版本所有数据
/application/mysql-5.5.48-linux2.6-x86_64/bin/mysqldump -h127.0.0.1 -uroot -pppz2323 -P3306 --all-databases>/root/msyql_backup/mysql5.5_all.sql
tar -zxf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
cp /application/mysql-5.5.48-linux2.6-x86_64/support-files/my-3307.cnf /application/mysql-5.6.36-linux-glibc2.5-x86_64/support-files/
cp /application/mysql-5.5.48-linux2.6-x86_64/support-files/my-3306.cnf /application/mysql-5.6.36-linux-glibc2.5-x86_64/support-files/
sed -i 's#mysql-5.5.48-linux2.6-x86_64#mysql-5.6.36-linux-glibc2.5-x86_64#g' my-3306.cnf
sed -i 's#mysql-5.5.48-linux2.6-x86_64#mysql-5.6.36-linux-glibc2.5-x86_64#g' my-3307.cnf
mkdir -pv /application/mysql-5.6.36-linux-glibc2.5-x86_64/logs/{3306,3307}
mkdir -pv /application/mysql-5.6.36-linux-glibc2.5-x86_64/data/{3306,3307}
mkdir -pv /application/mysql-5.6.36-linux-glibc2.5-x86_64/socket
mdkir -pv /application/mysql-5.6.36-linux-glibc2.5-x86_64/data/{3306,3307}
mkdir -pv /application/mysql-5.6.36-linux-glibc2.5-x86_64/data/{3306,3307}
Chown -R mysql:mysql mysql-5.6.36-linux-glibc2.5-x86_64
./mysql_install_db --basedir=/application/mysql-5.6.36-linux-glibc2.5-x86_64 --datadir=/application/mysql-5.6.36-linux-glibc2.5-x86_64/data/3306 --user=mysql
./mysql_install_db --basedir=/application/mysql-5.6.36-linux-glibc2.5-x86_64 --datadir=/application/mysql-5.6.36-linux-glibc2.5-x86_64/data/3307 --user=mysql
sed -i 's#mysql-5.5.48-linux2.6-x86_64#mysql-5.6.36-linux-glibc2.5-x86_64#g' /etc/init.d/mysqld1
sed -i 's#mysql-5.5.48-linux2.6-x86_64#mysql-5.6.36-linux-glibc2.5-x86_64#g' /etc/init.d/mysqld2
mysql -uroot -pppz2323-----------从服务器
mysql> change master to master_host='192.168.179.128',
master_user='mstest',
master_password='123456',
master_log_file='mysql-bin.000001',
master_log_pos=0;
start slave;
------------------------------------------------------------------------升级后要执行 mysql_upgrade 升级数据结构造成的否则授权时报如下错误
Column count of mysql.user is wrong. Expected 43, found 42. The table is probably corrupted
mysql_upgrade -h ppzCentos1 -uroot -pppz2323 --basedir=/application/mysql-5.6.36-linux-glibc2.5-x86_64/data/3306/ -P3306
mysql_upgrade -h ppzCentos1 -uroot -pppz2323 --basedir=/application/mysql-5.6.36-linux-glibc2.5-x86_64/data/3307/ -P3307
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于