升級前先請作好數據備份mysql
1.解壓tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gzlinux
2.關閉mysql5.6.23數據庫 service mysqld stopsql
3.將5.7.9版本放到默認目錄下面數據庫
mv mysql-5.7.9-linux-glibc2.5-x86_64 /usr/local/mysqlvim
4.修改/usr/local/mysql/data 下面的權限ide
chown -R mysql.mysql /usr/local/mysql/data日誌
5. cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldorm
6.修改配置文件 /etc/my.cnfserver
expire-logs-day=10 --->expire-logs-days=10ip
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