A lot of server administrators haven’t upgraded yet their MySQL 4.0 to the superior version ,
although MySQL 4.1 is available for some time now. By using a CPanel/ WHM server you can get this done through an easy and fast method that we will describe in the following paragraphs.
The basic steps are updating CPanel , then MySQL and afterwards rebuild Apache /PHP server so the whole job will take you about 40 minutes or more to completion.
You probably have now the old MySQL 4.0x version but to be sure you can have this checked out
through shell by typeing the following command:
# mysql -V
Upgrade MySQL 4.0 to MySQL 4.1
Because upgrading MySQL is an irreversible major provedure I sugest you take some time to get
well informed before proceeding .There are lots of extremly useful notes and documents available
regarding this subject so you should check them out before starting this MySQL tutorial.
Start upgrading - MySQL 4.1 Setup
As we have already mentioned , the first step is making sure we have the latest version of
CPanel on pur system and if you discover it is not updated proceed through WHM Upgrade to
Latest Version or by this shell :
# /scripts/upcp
After the Cpanel Update you must go to WHM -> Server Configuration -> Tweak Settings
After that you must check the MySQL 4.1 option ( be careful not to select old authentication).
After you press the Save button at the bottom of the page you should see on the screen a message
saying something like ” Changes saved ,. If you made some changes to your MySQL version , Click
Here in after 30 seconds in order to keep the changes .Your system will restart automatically.”
So after we wait 30 sec as asked we click on the indicated link.
At this point , Cpanel will search and grab the latest version of MySQL ( 4.1.13 at the time we
wrote this) and the installation will be done through RPMs.
You know it’s completed when you see a bolded text an your screen stating ” Complete”.
How to Update PHP to support MySQL 4.1
Once you have MySQL 4.1 you may experience some errors in yur console such as :
# php -v
php: error while loading shared libraries : libmysqlclient.so.12: cannot open shared object file:
No such file or directory
This happens because your current PHP doesn’t work with the new MySQL so what you shoul do is
recompilling Apache/ PHP and make it adapt to the new changes as fast as possible.
In order to continue with the update of the Apache/PHP you should see the detalied tutorial
/scripts/easyapache in shell:
# /scripts/easyapache
In about 20 minutes or so you will finish the rebuilt of Apache server but be carefull not to
modify here any of the default MySQL options. Check the other options you want to set and
don’t forget to save the changes after you finish.
In order to see if the new installed Apache is functioning corectly you need the do a shell
command again :
# php –v
If everything is in order it should prompt you with the information about PHP version , without
showing any errors.
PHP 4.4.1 (cli) (built: Nov 7 2005 19:23:38)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
To see information about your MySQL version enter the following shell command:
# mysql –V
Something like this should appear:
mysql Ver 14.7 Distrib 4.1.13, for pc-linux-gnu (i686) using readline 4.3
Finally the upgrade is complete and you deserve some sort of reward for your hard work.
Upgrade Problems for MySQL 4.1?
In order to do the upgrade without encountering any problems make sure you have rebuilded
Apache/PHP corectly because if you fail then the websites will be unable to connect to your
databases because of the out of sync libraries .
Note:
The 4.1 MySQL comes along with some changes in the databases aspect because it introduces new
fields to tables . So , for instance you may observe that you are unable to restore a MySQL 4.1
database to a 4.0 database and viceversa , beacuse each of the versions does not support the new
fields.This means you shoul upgrade all of your systems at the same time if you have more than
one machine because moving databases around it’s not a viable option.