Documentation > How-to Classification > MySQL > How to Upgrade MySQL to 4.0.x for SME Server > Feedback


Give your comments on How to Upgrade MySQL to 4.0.x for SME Server here. Thanks in advance!

One too many lines deleted in your last edit...
above:
ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/init.d/mysql
you still need:
mv /etc/rc.d/init.d/mysql /etc/rc.d/init.d/mysqld

and a note if this is used with (at least with the beta) 6.5 is you need to specify the mysql root password when running the fix_privilege_tables part - this will get it automatically if used in a script:

MYSQL_PW=`sed q /etc/openldap/ldap.pw`
/usr/bin/mysql_fix_privilege_tables --user=root --password=$MYSQL_PW

*****************************************************

In fact the Howto doesn't work as a result of this root user password problem. So why not add lines that reset the password before attempting to fix the privilege tables?

Here is a new version of the Howto incororating that change...

This changed Howto deals with problems found with update to MySQL 4.1.10a-standard on a box loaded with a customised 6.0.1 server. It adds lines from Dan Brown's 'How to change the MySQL root password in SME Server 5.1.2' to reset the MySQL root access password before attempting to use it to fix the privilege tables etc.

1) DOWNLOAD MySQL 4.0

Download MySQL 4.0 rpms from mysql.com in a fresh directory (Linux x86 RPM downloads section).

You need
  • MySQL-shared-compat-4.1.x-0.i386.rpm
  • MySQL-server-4.1.x-0.i386.rpm
  • MySQL-client-4.1.x-0.i386.rpm
  • MySQL-devel-4.1.x-0.i386.rpm

Note: replace 4.1.x with current MySQL version available (I used 4.1.10a)

2) STOP MYSQL

service mysqld stop

3) REMOVE OLD RPMS

rpm -e --nodeps mysql mysql-server
rpm -e mysql-devel
rpm -e mysqlclient9

4) INSTALL NEW RPMS

Cd to the directory where you downloaded the rpms and do
rpm -Uvh MySQL-*.rpm

OR

rpm -Uhv MySQL-shared-compat-4.1.x-0.i386.rpm

rpm -Uhv MySQL-server-4.1.x-0.i386.rpm

rpm -Uhv MySQL-client-4.1.x-0.i386.rpm

rpm -Uvh MySQL-devel-4.1.x-0.i386.rpm

Note: replace 4.1.x with current MySQL version available (I used 4.1.10a)

5) CONFIGURE

chkconfig --levels 2345 mysql on

mv /etc/rc.d/init.d/mysql /etc/rc.d/init.d/mysqld

rm /etc/rc.d/rc7.d/S90mysqld

ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc7.d/S90mysqld

/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no (enables remote access)

/sbin/e-smith/expand-template /root/.my.cnf

ln -s /usr/sbin/mysqld /usr/libexec/ (for conf-mysql-password script)

/etc/rc.d/init.d/mysqld start

Then to make sure that your grant tables are current when you update to the new version, first reset the root password...

/etc/rc.d/init.d/mysqld stop

/etc/e-smith/events/actions/conf-mysql-password

/etc/rc.d/init.d/mysqld start

Then run...

/usr/bin/mysql_fix_privilege_tables

More info here: http://dev.mysql.com/doc/mysql/en/Upgrading-grant-tables.html

6) OPTIONAL: INNODB SUPPORT

Create a custom-template fragment
mkdir -p /etc/e-smith/templates-custom/etc/my.cnf cp /etc/e-smith/templates/etc/my.cnf/009innodb /etc/e-smith/templates-custom/etc/my.cnf pico /etc/e-smith/templates-custom/etc/my.cnf/009innodb

And comment the only line it contains so the file should look like this:

  1. skip-innodb
Save the file then do
/sbin/e-smith/expand-template /etc/my.cnf
service mysqld restart