I previously installed MySQL 5.1 using the installer, since then created a number of users/databases, and now would like to upgrade to 5.6. What is the procedure to do so?
How to upgrade the MySQL 5.1 to MySQL 5.6, and migrate data
MySQLupgrade
Related Question
- MacOS – MySQL and server settings when upgrading Mac Pro from 10.6 to 10.7
- MacOS – How to add MySQL to $PATH variable to resolve “thesql: command not found”
- MacOS – MySQL fails to start after update
- MacOS – Upgrade to El Capitan has broken MySQL and Apache
- How to recover the built in Directory Service data
- How to start a thesql server on login
- MacOS – Can you run the latest MySQL security update on macOS 10.12 Sierra
- How to proper setting root thesql password
Best Answer
The following assume your MySQL 5.1 is installed in
/usr/local/mysql-5.1.46-osx10.6-x86_64
and that MySQL 5.6 will install in/usr/local/mysql-5.6.11-osx10.7-x86_64
. The exact directory names might differ depending on the exact version number you are using.mysql-5.6.11-osx10.7-x86_64.pkg
sudo mv /usr/local/mysql-5.6.11-osx10.7-x86_64/data /usr/local/mysql-5.6.11-osx10.7-x86_64/data.save
sudo cp -a /usr/local/mysql-5.1.46-osx10.6-x86_64/data /usr/local/mysql-5.6.11-osx10.7-x86_64/
mysql_upgrade
, which checks all the tables and upgrades system tables