sudo /usr/local/mysql/support-files/mysql.server stop
到mysql官網抓取安裝程式
在此安裝了mysql 5.6.20
點選下載下來的.pkg檔案,安裝MySQL Server
確認/usr/local/mysql是否指定新版的sql
1.ls -al /usr/local/mysql
2.lrwxr-xr-x 1 root wheel 27 8 24 23:36 /usr/local/mysql -> mysql-5.6.20-osx10.8-x86_64
將舊版本data複製到新版
1.cd /usr/local
2.sudo cp -rf mysql-5.5.27-osx10.6-x86_64/data/ mysql-5.6.20-osx10.8-x86_64/data/
3.確認權限是否正確,如果不對,利用sudo chown -R 更改權限
啟動新版本的MySQL
sudo /usr/local/mysql/support-files/mysql.server start
執行升級程序
1.sudo /usr/local/mysql/bin/mysql_upgrade
2.sudo /usr/local/mysql/support-files/mysql.server restart
更新密碼
/usr/local/mysql/bin/mysqladmin -u root password 'password'
Note:
官方說明文件