Upgrading to MySQL V5

DamnSkippy

Verified User
Joined
Mar 16, 2005
Messages
273
Location
USA, Texas
Other than changing the name of the rpm files as it is a different version now will this code still work to update from 4.1 to 5.0? I am running CentOS 4.3, PHP5.1, Apache 2.2.

Code:
#!/bin/sh

service mysql stop

cd $HOME

echo -e "\n\n\033[1;37mUpgrade to what version? 5.0.15\033[0m"
read INSTALL_VER

echo -e "\n\n\033[1;37mUpgrading to MySQL 5.0.15\033[0m\n\n";

wget [url]http://dev.mysql.com/get/Downloads/...rrors.pair.com/[/url]
wget [url]http://dev.mysql.com/get/Downloads/...rrors.pair.com/[/url]
wget [url]http://dev.mysql.com/get/Downloads/...wisc.edu/mysql/[/url]
wget [url]http://dev.mysql.com/get/Downloads/...mysql.orst.edu/[/url]

rpm -Uvh ./MySQL-server-5.0.15-0.rhel4.i386.rpm ./MySQL-client-5.0.15-0.rhel4i386.rpm ./MySQL-devel-5.0.15-0.rhel4.i386.rpm ./MySQL-shared-5.0.15-0.rhel4.i386.rpm

rm -fr ./MySQL-server-5.0.15-0.rhel4.i386.rpm ./MySQL-client-5.0.15-0.rhel4.i386.rpm ./MySQL-devel-5.0.15-0.rhel4.i386.rpm ./MySQL-shared-5.0.15-0.rhel4.i386.rpm

service mysql restart

echo -e "\n\n\033[1;37mSuccessfully upgraded to MySQL 5.0.15\033[0m\n\n";
rm -f /etc/init.d/mysql
rm -f /etc/rc?.d/*mysql

exit 0;

I am not sure why these two commands are needed:

rm -f /etc/init.d/mysql
rm -f /etc/rc?.d/*mysql

Seems that you would still need the init scripts. Can someone explain this part?

Also do I only need to recompile PHP and not Apache?

I do not want to move to 5.0 but the client that rents the server wants to run an app that requires it :(
 
Last edited:
Acyually the more I look at that script I can just wget the files and do the rpm -uvh for each one by hand.

However deleting the rc files still puzzels me. I am still unsure about needing to recompile only PHP or if Apache needs it also. Do all the things like zzip need to be compiled as well?
 
Last edited:
Those rm commands delete the init scripts that come with the default mysql rpm files. DA ships with the init scripts named mysqld. Without deleting the ones named mysql, there would be two attempts to start the mysql daemon during boot up.
 
Thanks for that info!

By the way I did the install using the cli to instal/upgrade each rpm and it went fine. I had to install one dep, something with perl. Then I recompiled PHP and Zend without compiling zzip etc and it worked fine.

Only problem so far is I can not connect as root from the cli using the da_admin pass. I have tried reseting the root pass using a file with a command in it but that has not helped either.
 
root and da_admin are two different users, their passwords should be different. You should be able to log in as da_admin and change the password for root.
 
Back
Top