MySQL5.6.25升级MySQL5.7.15
2017-01-10 19:14
274 查看
升级
环境介绍
Part1:写在最前提到MySQL升级,网上文章数之不尽,但大多数为老的版本,诸如升级到、升级到,今天给大家介绍下升级到版本的方法和注意事项。
Part2:升级方法
升级的方法一般有两类:
1.利用mysqldump来直接导出sql文件,导入到新库中,这种方法是最省事儿的,也是最保险的,缺点的话,也显而易见,大库的mysqldump费时费力。
2.直接替换掉mysql的安装目录和,利用mysql_upgrade 来完成系统表的升级,这种方法需要备份原有的文件,但属于物理拷贝,速度较快。缺点的话,跨版本升级不推荐这么做,比如升级到,升级到等。
本文采用的是第二种方法升级。
Part3:环境
数据库软件目录:/usr/local/mysql
位置:/etc/
数据库data目录:/data/mysql
慢日志目录:/data/slowlog
准备工作
Part1:# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: -log MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select version(); +------------+ | version() | +------------+ | -log | +------------+ 1 row in set ( sec) mysql> use helei; Database changed mysql> show tables; +-----------------+ | Tables_in_helei | +-----------------+ | helei | +-----------------+ 1 row in set ( sec)
我这里用的是版本作为待升级库,库中已经模拟和创建了数据库helei和表helei,用以之后验证升级。
[root@HE3 ~]# /etc//mysqld start
Starting MySQL..... SUCCESS!
[root@HE3 ~]# ps -ef|grep mysql
root 26467 1 0 20:30 pts/2 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/
mysql 27197 26467 4 20:30 pts/2 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/ --open-files-limit=8192 --pid-file=/data/mysql/ --socket=/tmp/ --port=3306
root 27235 25656 0 20:31 pts/2 00:00:00 grep mysql
这里虽然启动成功了,但error日志里能捕捉到很多错误信息,因为没有升级字典,诸如:
2016-10-20T03:30: 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_program' has the wrong structure 2016-10-20T03:30: 0 [ERROR] Native table 'performance_schema'.'events_transactions_current' has the wrong structure 2016-10-20T03:30: 0 [ERROR] Native table 'performance_schema'.'events_transactions_history' has the wrong structure 2016-10-20T03:30: 0 [ERROR] Native table 'performance_schema'.'events_transactions_history_long' has the wrong structure 2016-10-20T03:30: 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_thread_by_event_name' has the wrong structure
相关文章推荐
- MySQL5.6.25升级MySQL5.7.15
- Mysql从5.6.14安全升级至mysql5.6.25的方法
- 源码安装 mysql 5.5.20升级到mysql 5.6.25
- Mysql从5.6.14安全升级至mysql5.6.25的方法
- MySQL 4.0 升级到5.0
- Mysql 4.1 Windows 下升级问题
- mysql4.1导入mysql5.0乱码问题方法(latin1升级到utf8)
- 图解MYSQL的安装和数据升级第1/2页
- Mysql 4.1 Windows 下升级问题
- Windows系统下升级PHP的MySQL客户端
- MySQL升级:从MySQL4.1到MySQL5.0
- mysql升级到5.x版本
- Mysql 数据库字符集转换及版本升级/降级的详细教程
- 升级 MySQL(MySQL 中文网)
- Mysql转换或者升级以后出现乱码情况的说明
- 再谈MySQL升级出现乱码问题的解决
- MySQL 4到5的快速升级
- mysql 升级后问题解决
- MySQL4升级到MySQL5保留字的变化
- MySQL 4.0 升级到5.0(from 21tx)