升级前先请做好数据备份

1.解压tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz

2.关闭mysql5.6.23数据库  service mysqld stop

3.将5.7.9版本放到默认目录下面

mv mysql-5.7.9-linux-glibc2.5-x86_64 /usr/local/mysql

4.修改/usr/local/mysql/data 下面的权限

chown -R mysql.mysql /usr/local/mysql/data

5. cp /usr/local/mysql/support-files/mysql.server  /etc/init.d/mysqld

6.修改配置文件 /etc/my.cnf

expire-logs-day=10     --->expire-logs-days=10

7.启动service mysqld start

8.错误日志及处理

升级后启动数据库会提示 没有初始化提示[

ERROR] Native table 'performance_schema'.'memory_summary_by_user_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_transactions_summary_by_account_by_event_name' has the wrong structure

使用如下命令就可以解决

/usr/local/mysql/bin/mysql_upgrade -u root -p

9.为了方便管理可以添加环境变量修改PATH变量

vim /etc/profile 

export PATH=$PATH:/usr/local/mysql/bin

10.修改密码

# vi /etc/my.cnf 

在[mysqld]的段中加上一句:skip-grant-tables