- Change to root.
- Backup import data. Ex: /etc, /var/log, web, mysql ...
- yum update
- reboot
Reference: Upgrade to CentOS 6.7 from CentOS 6.6/6.5/6.4/6.3/6.2/6.1/6.0
● Upgrade PHP 5.6
- wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
- vi /etc/yum.repos.d/remi.repo。設定 [remi] 和 [remi-php56] 的 enabled=1
- yum update php*
● Upgrade MySQL 5.7
- service mysqld stop
- Backup MySQL databases. mkdir /var/lib/mysqlcopy; cp -aR /var/lib/mysql/* /var/lib/mysqlcopy
- Backup to file. mysqldump -u root -p --all-databases > all.sql
- vi /etc/yum.repos.d/atomic.repo, enabled = 0 (若沒有 atomic.repo 可跳過)
- yum install http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
- vi /etc/yum.repos.d/mysql-community.repo。設定 [mysql57-community] 的 enabled=1
- yum update mysql
- service mysqld start
Reference: How to upgrade MySQL 5.5 to 5.6/5.7 on Linux
● MySQL Daemon failed to start after upgrade
請查看 /var/log/mysqld.log 的啟動失敗記錄。
我遇到的是 Fatal error: mysql.user table is damaged.
這一篇說只能重建 database。
如果希望復原資料(我沒試過):
● MySQL Daemon failed to start after upgrade
請查看 /var/log/mysqld.log 的啟動失敗記錄。
我遇到的是 Fatal error: mysql.user table is damaged.
這一篇說只能重建 database。
如果希望復原資料(我沒試過):
- 另外裝一台舊版的 mysql
- 把 /var/lib/mysql/* 複製過去
- 重新啟動 mysqld
- 用 mysqldump 把舊資料轉出成一個檔案 all.sql
- 把 all.sql 拿到 mysql 5.7 匯入。指令為 mysql -u -p < all.sql
Reference:
● 重建 database
- rm -fr /var/lib/mysql
- mysqld --initialize --user=mysql
- service mysqld restart
- grep 'temporary password' /var/log/mysqld.log (取得臨時密碼)
- mysql_secure_installation (重設密碼)
Reference:
沒有留言:
張貼留言