Help - Search - Members - Calendar
Full Version: How to Upgrad MySQL version 3 to 4 RedHat / Fedora
The Planet Forums > Control Panels > Plesk > Plesk HOWTOs
Hodjat
by Tony Smith on 2004-01-25 (UPDATED 2004-12-25)

----------------------------------------------------------
Hodjat: Hope this article can help you to upgrade your Mysql.
-----------------------------------------------------------


As you know the version of MySQL that is supplied by default with Fedora and the Red Hat Enterprise Linux versions is 3.23-58 whereas the current stable production version is 4.1.7-0. With the prospect that we aren't likely to provided with rpms for this current version from Red Hat for the foreseeable future, how do we upgrade, whilst maintaing the format we are familiar with Fedora/Red Hat.

Step 1. Obtain the source

Obtain the source rpm from MySQL from http://dev.mysql.com/downloads/mysql/4.1.html.

Step 2. Extract The Source

Once the source rpm has been downloaded, extract it using rpm -ivh as shown below:

#rpm -ivh MySQL-4.1.7-0.src.rpm [ENTER]

This will extract the source tar file to /usr/src/redhat/SOURCES.

Now download the files mysql.init and my.cnf-def to /usr/src/redhat/SOURCES

Step 3. Build the rpms

Now we will build a new set of rpms, however we will not use the supplied spec file from MySQL, but instead we will use a customized version.

Download the file mysql4.1.spec to /usr/src/redhat/SPECS

We are now in the position to build our brand new mysql rpms. To do this change directory to /usr/src/redhat/SPECS

Now issue the command

#rpmbuild -ba mysql4.1.spec [ENTER]

When issuing this command you may encounter some failed dependancies, install the requisite rpms and re-issue the above command.

Once the rpmbuild is in full swing, it takes a while for it all to compile....

However, anything around an hour the new rpms are ready to install. These can be found in the following directory /usr/src/redhat/RPMS/i386 and consist of the following:

mysql-bench-4.1.7-0FC2.i386.rpm
mysql-embedded-4.1.7-0FC2.i386.rpm
mysql-client-4.1.7-0FC2.i386.rpm
mysql-Max-4.1.7-0FC2.i386.rpm
mysql-debuginfo-4.1.7-0FC2.i386.rpm
mysql-server-4.1.7-0FC2.i386.rpm
mysql-devel-4..1.7-0FC2.i386.rpm
mysql-shared-4.1.7-0FC2.i386.rpm

You will also find that you now have your very own custom built source rpm in /usr/src/redhat/SRPMS

mysql-4.1.7-0FC2.src.rpm.

Step 4. Prevent Breaking Dependancies

Attempting to install these newly created RPMs at the momoent will prove troublesome hitting a number of failed dependancies such as php-mysql, qt-mysql .... etc. One option would be to install mysql-4.1, and then re-compile all the failed dependancies, and re-install the dependancies. However there is a far better method, for which thanks is owed to Kenneth Porter for pointing out, and supplying the MySQL-shared-compat.spec file.

To use this spec file, we need to obtain the standard mysql-3.23.58-9.i386.rpm NOT the source rpm. This rpm needs to be copied to /usr/src/redhat/SOURCES and MySQL-shared-compat.spec should be copied to /usr/src/redhat/SPECS

Once the above files have been copied to the correct locations simply build the mysql-shared-compat-3.23.58-9.i386.rpm by issuing the command shown below:

#rpmbuild -ba MySQL-shared-compat.spec [ENTER]

This command should be entered when in the directory
/usr/src/redhat/SPECS

This rpm only takes a short while to be created, the mysql-shared-compat-3.23.58-9.i386.rpm rpm is created in the directory

/usr/src/redhat/RPMS/i386

Step 5. Install The RPM(S)

To install your new rpm(s) change directory to, /usr/src/redhat/RPMS/i386 the first time we are installing these we need to force the installation, due to file confilcts between mysql-shared-compat-3.23.58-9.i386.rpm and the currently installed standard rpm. Also the mysql-shared-compat-3.23.58-9.i386.rpm rpm will only be required the once, and will not need to be recompiled for any further subsequent updates. Simply install your required rpms as shown below:

#rpm -Uvh --force mysql-shared-compat-3.23.58-9.i386.rpm mysql-server-4.1.7-0FC2.i386.rpm [ENTER]

Step 6. Post Install
Currently the mysql-shared-compat-3.23.58-9.i386.rpm does not update the file

/etc/ld.so.conf so this has to accomplished manually. Add the following line to /etc/ld.so.conf

/usr/lib/mysql

Then execute the command ldconfig as shown below:

#ldconfig [ENTER]

To start the mysql daemon simply enter the command:

#service mysqld start [ENTER]

Note, if this is a completely new install of MySQL, then the first time that you run the service, MySQL will be initailized.

However, if this is an upgrade from MySQL version 3 then to take advantage of the new priviledge/security features follow the instructions set out at the following address

http://www.mysql.com/doc/en/Upgrading-from-3.23.html
dbenner
this is compatible with plesk 7.1?

Thanks
cloud
Thanx very much for publishing this article. I'm very happy when I found it, but now, after an hour compiling rpms... I obtained an error.
last rows are:
CODE
make[2]: Leaving directory `/usr/src/redhat/BUILD/mysql-4.1.12/tools'

make[1]: Leaving directory `/usr/src/redhat/BUILD/mysql-4.1.12'

+ mv sql/mysqld sql/mysqld-max

+ nm --numeric-sort sql/mysqld-max

+ install -m 644 libmysqld/libmysqld.a /var/tmp/mysql-4.1.12-build/usr/lib/mysql

+ '[' gcc = gcc ']'

++ gcc --print-libgcc-file

+ libgcc=/usr/lib/gcc/i386-redhat-linux/3.4.2/libgcc.a

+ '[' -f /usr/lib/gcc/i386-redhat-linux/3.4.2/libgcc.a ']'

+ install -m 644 /usr/lib/gcc/i386-redhat-linux/3.4.2/libgcc.a /var/tmp/mysql-4.1.12-build/usr/lib/mysql/libmygcc.a

+ cd libmysql/.libs

+ tar cf /var/tmp/mysql-4.1.12-build/shared-libs.tar libmysqlclient.so libmysqlclient.so.14 libmysqlclient.so.14.0.0

+ cd libmysql_r/.libs

+ tar rf /var/tmp/mysql-4.1.12-build/shared-libs.tar libmysqlclient_r.so libmysqlclient_r.so.14 libmysqlclient_r.so.14.0.0

+ mv Docs/manual.ps Docs/manual.ps.save

mv: cannot stat `Docs/manual.ps': No such file or directory

error: Bad exit status from /var/tmp/rpm-tmp.4892 (%build)





RPM build errors:

   Bad exit status from /var/tmp/rpm-tmp.4892 (%build)

[root@localhost SOURCES]#


If someone can help me... thanx... I don't know what it is.
I'm waiting and thinking about this problem.

Bye,
cloud
kwabbernoot
Hi,

I get the same error when using the source MySQL-4.1.12-1.

The compilation and creation of rpm packages succeeds when using MySQL-4.1.11-0.glibc23.src.rpm from the MySQL Download site.

My system is a RedHat 9 using glibc-2.3.2-27.9.7.

The only changes I made in the spec file is the following
Update the first line to the mysql version you want to compile
CODE
%define mysql_version           4.1.11


Change
CODE
# Save manual to avoid rebuilding

mv Docs/manual.ps Docs/manual.ps.save

make clean

mv Docs/manual.ps.save Docs/manual.ps


to
CODE
# Save manual to avoid rebuilding

[B]#[/B]mv Docs/manual.ps Docs/manual.ps.save

make clean

[B]#[/B]mv Docs/manual.ps.save Docs/manual.ps


Hope this helps,
Kwabbernoot
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.