This is based on Nathan's own instructions for the Gamma release (4.0.10-0) of MySQL, and he should get all the credit for the howto. I just whipped this up in case some of you didn't know that 4.0.12-0 is OUT and considered production status
How to Upgrade to MySQL 4.0.12-0 on Ensim
This info is provided "as-is" and that I am not to be held responsible for any damages done. MySQL 4 has some issues playing nice with Ensim and it would NOT be a good idea to upgrade right now unless you are prepared to deal with them on a manual level.
You should be aware that after upgrading to MySQL 4, ensim will not be able to add databases when you add a new account. You must create them manually. Again - ensim 3.1.8 and below do NOT detect the presence of MySQL 4 and will NOT create accounts automatically. This isn't a big deal if you are like me and like to do things manually anyway. Hopefully the next version of ensim will offer compatability with MySQL 4.
IT'S YOUR RESPONSIBILITY IF YOU SCREW YOUR BOX UP
log into your server via SSH (or Telnet if you are a nut case) and becoming root, making a tmp dir...
su -
mkdir mysql4
cd mysql4
Next you can grab the files:
wget ftp://mysql.secsup.org/pub/software/mysql...0.12-0.i386.rpm
wget ftp://mysql.secsup.org/pub/software/mysql...0.12-0.i386.rpm
wget ftp://mysql.secsup.org/pub/software/mysql...-0.i386.rpm
! BACKUP BACKUP BACKUP !
Let's backup your databases to be 100% safe!
mysqldump --all-databases -uroot -p > backup.sql
This will prompt you for your root MySQL password, enter it and it will create a backup of your MySQL databases.
Now before the upgrade you really need to stop apache, your current version of MySQL and, all their processes, so do this:
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/mysqld stop
/etc/rc.d/init.d/mysql stop
Then:
killall -9 httpd
killall -9 mysqld
killall -9 mysql
If you are running SIM you are going to need to disable it as it will cause problems. You can do this via:
/usr/local/sim/sim -j
Next we need to figure out which MySQL RPMs to remove. You want to remove mysql, mysql-server and mysql-devel. You can get the exact names via:
rpm -qa | grep mysql
Depending upon how up to date your system is, you should recieve an output similar to (your version numbers might be different):
root [~] #rpm -qa | grep mysql
webppliance-mysql-prolog-3.1.0-25
webppliance-mysql-epilog-3.1.0-25
mysql-devel-3.23.54a-3.72
mysql-server-3.23.54a-3.72
virtualhosting-fst-mysql-3.1.0-25
webppliance-mysql-frontend-3.1.0-25
webppliance-mysql-3.1.3-4
mysql-3.23.54a-3.72
root [~] #
See the ones in bold? MySQL, the server, and the devel? You need to uninstall these packages first (remember, the version numbers on your system may vary):
rpm -e --nodeps mysql-devel-3.23.54a-3.72
rpm -e --nodeps mysql-server-3.23.54a-3.72
rpm -e --nodeps mysql-3.23.54a-3.72
Then you should be able to install the new RPMs for MySQL 4:
rpm -ivh MySQL-server-4.0.12-0.i386.rpm
rpm -ivh MySQL-client-4.0.12-0.i386.rpm
rpm -ivh MySQL-devel-4.0.12-0.i386.rpm
MySQL 4 should then be able to start using:
/etc/rc.d/init.d/mysql start
It will come up as:
root [~] #/etc/rc.d/init.d/mysql start
root [~] #Starting mysqld daemon with databases from /var/lib/mysql
You need to press [ENTER] here to start using those databases. If all goes well you will have MySQL 4 running and you will be able to check the version by:
mysql -V
It shoudl return this:
root [~] #mysql -V
mysql Ver 12.18 Distrib 4.0.12, for pc-linux (i686)
root [~] #
Other Issues
If you have issues starting up MySQL after you have installed it
first try shutting down MySQL again with:
/etc/rc.d/init.d/mysql stop
And then killing all MySQL processes:
killall -9 mysql
Then try starting MySQL with:
/etc/rc.d/init.d/mysql start
Also check your log file which should be located in /var/lib/mysql/ and you can do so by:
cat cat /var/lib/mysql/boxhostname.com.err
If it gives an error about a mysql library. Just symlink it.
Other issue is with how MySQL 4 hangs at startup, SIM has some problems with this and it might cause your server to crash. To fix this you can just run "autoconf" in the SIM directory and disable MySQL monitoring.
If PHP is having problems connecting to MySQL you will need to upgrade your phpmysql package and recompile/reload PHP for MySQL to work. This hasn't happened on any of my boxes (Mine neither - Nacho) but it is a possibility for other boxes.
I think that pretty much about covers the entire upgrade...pretty simple IMO....and now you have the supperdooper power of subselects...w00t! If you have any questions or anything about why something was done or if something should be added or if something went wrong durning the install, etc just post and hopefully someone can try and help you out.