TopicNavigationUser login |
Upgrading MySQLThis article relates to upgrading MySQL on Redhat linux, but may be applicable to other OSes as well. Here's the short version: And the long version: The first and most important step: ADD MYSQL TO THE PACKAGE SKIP LIST!! up2date --configure 20 kernel*;mysql*; ...just add 'mysql*;' to the existing package skip list. If you forget this part, great woe will befall you the next time Redhat rolls out a MySQL update. The next step is to download the required RPMs from mysql.com (mysql doesn't offer support for custom mysql packages, and honestly there is no good reason that I am aware of to use non-standard mysql packages any more, even on Plesk systems). You'll need: Make sure to choose the version appropriate for the version of Redhat, and the architecture of the system. Just because the system is running on a 64-bit proc, this DOES NOT mean you need the 64-bit version of MySQL... use 'uname -a' and check the architecture of the kernel if there is any question... newer 64-bit procs support 32-bit functionality, and the vast majority run a 32-bit OS. After you have the RPMs, you are going to want to perform a full backup of the databases prior to upgrading: mysqldump -Q -A --opt [-uUsername -pPassword] >mysqlbak.sql Then stop MySQL (a quick note on init scripts: Redhat uses /etc/init.d/mysqld for its init script, and mysql.com uses /etc/init.d/mysql... I've found it useful to just symlink whichever one doesn't exist, so that either will work), verify that no MySQL processes are running, and proceed to install the RPMS: service mysqld stop ps auxww|grep -i mysql rpm -Uvh mysql*rpm There will generally be one or two things that break depending on the versions of Redhat and MySQL involved, so don't worry if MySQL doesn't start properly yet. Assuming it DID start properly, do a 'service mysql stop' and 'service mysql start'. If it stops and starts without error, run 'mysql' to connect, verify the version, verify the databases are there 'show databases;', and you're all set! One last thing: if a downgrade may be necessary at any point in the future, and you are upgrading from a version prior to 4.1 to 4.1 or greater, add: Ok, so MySQL DIDN'T start properly... now what? First, verify no MySQL processes are running... kill off any running processes and try to restart again. Then, verify that the MySQL user exists, and add the user if not: grep -i mysql /etc/passwd useradd -u 27 -d /var/lib/mysql -s /bin/bash mysql As a note, it's possible that a uid other than 27 may be used (just ls -ld /var/lib/mysql to verify the uid) If it still doesn't work, either comment out the basedir=/var/lib from /etc/my.cnf or edit /etc/init.d/mysql and comment out the call to the 'parse_server_arguments' function (I believe this issue is specific to MySQL 5). That's all there is to it!
Submitted by jkelly on Sun, 2006-08-13 08:02. categories [ Article | MySQL | Redhat Linux ]
login or register to post comments
|
Linux JournalSlashdot |