MySQL5.6升级5.7步骤
升级步骤:
1、对mysql5.6进行全库备份(******)用于失败倒回 2、关闭mysql5.6版本数据库 3、将mysql5.7软件部署 4、修改配置信息 5、修改启动脚本 6、启动mysql5.7数据库 7、mysql_upgrade升级数据库相关参数 8、重启数据库,测试升级结果
首先对数据库进行物理备份,利用Percona Xtrabackup.
关闭5.6的数据库
安装5.7的二进制安装包.
修改/etc/profile 改变环境变量指向5.7.执行source /etc/profile 生效
编辑5.7的system启动文件
[Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql ExecStart=/data/app/mysql/bin/mysqld --defaults-file=/mysql/3306/my.cnf LimitNOFILE = 5000
启动数据库
systemctl start mysqld
使用mysql_upgrade 检查
[ ~]# mysql_upgrade -S /mysql/mysql.sock Checking if update is needed. Checking server version. Running queries to upgrade MySQL server. Checking system database. mysql.columns_priv OK mysql.db OK mysql.engine_cost OK mysql.event OK mysql.func OK mysql.general_log OK mysql.gtid_executed OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.innodb_index_stats OK mysql.innodb_table_stats OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.server_cost OK mysql.servers OK mysql.slave_master_info OK mysql.slave_relay_log_info OK mysql.slave_worker_info OK mysql.slow_log OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK Upgrading the sys schema. Checking databases. sys.sys_config OK world.city OK world.country OK world.countrylanguage OK Upgrade process completed successfully. Checking if update is needed.
重启数据库
[ ~]# systemctl restart mysqld [ ~]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 8902/sshd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 8912/postmaster tcp6 0 0 :::3306 :::* LISTEN 10347/mysqld tcp6 0 0 :::22 :::* LISTEN 8902/sshd tcp6 0 0 ::1:5432 :::* LISTEN 8912/postmaster
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
bianruifeng 2020-11-16
云中舞步 2020-11-12
世樹 2020-11-11
暗夜之城 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
tufeiax 2020-09-03
疯狂老司机 2020-09-08
王艺强 2020-11-17
aydh 2020-11-12
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
xjd0 2020-09-10