Hello Benjo,
You would not use yum to update MySQL on cPanel, since we provide our own MySQL rpms that we build during a MySQL upgrade process.
First, before doing anything, please make a backup of your MySQL databases using this command:
Code:
mysqldump --add-drop-table --all-databases | gzip > /home/alldatabases.sql.gz
This will save a copy of all databases to /home/alldatabases.sql.gz location in case anything goes wrong with the MySQL upgrade.
Next, go to WHM > Software > MySQL Upgrade to go through the upgrade process. You will need to run EasyApache after the upgrade, so I would suggest selecting "Rebuild Apache and PHP automatically with last saved defaults." in Step 3 where it has the "Unattended upgrade." option. Otherwise, if you choose the interactive option, you'll be given an opportunity to rebuild Apache and PHP at that point. If you do not select to rebuild Apache and PHP after updating MySQL if the version is changed (from 4.1 to 5.0 or from 5.0 to 5.1), then PHP will not have the correct libmysql built and PHP + MySQL will cease functioning properly.
After the upgrade completes, you would want to check MySQL is running in command line by running the following:
Code:
ps aux | grep mysql
mysqladmin proc
If everything is working for your sites, the upgrade has been successful.
If you run into any issues, please check the MySQL error logs upon the upgrade to see what it is indicating. They will be located at /var/lib/mysql and named hostname.err where hostname is the fully qualified hostname for the machine. You can normally locate that log using this command:
Code:
ls -lah /var/lib/mysql/*.err
Once you find the log, simply tail it for any errors:
Code:
tail -500 /var/lib/mysql/hostname.err
If you do need to restore your databases for any reason from the previously created backup dump file, you can use these steps to do so:
1. First, get the MySQL root password:
2. Restore the databases from the backup
Code:
gunzip < /home/alldatabases.sql.gz | mysql -u root -p
You'll be asked for the password here, so simply enter the one noted in /root/.my.cnf location.