1) Download Server from...
http://mysql.com/downloads/mirror.php?id=395761
MySQL-server-community-5.1.52-1.rhel5.x86_64.rpm
Download client from ...
http://mysql.com/downloads/mirror.php?id=395683
MySQL-client-community-5.1.52-1.rhel5.x86_64.rpm
Stop current MySQL deamon before installing the new version.
2) I have to uninstall 5.0 before installing 5.1 or else I get an error as shown below:
# rpm -ivh MySQL-client-community-5.1.52-1.rhel5.x86_64.rpm MySQL-server-community-5.1.52-1.rhel5.x86_64.rpm
error: Failed dependencies:
MySQL conflicts with mysql-5.0.77-3.el5.x86_64
MySQL-server conflicts with mysql-server-5.0.77-3.el5.x86_64
3) While uninstalling 5.0 I was informed that the dependencies too needs to be removed.
# rpm -e mysql-5.0.77-3.el5
error: Failed dependencies:
libmysqlclient.so.15()(64bit) is needed by (installed) perl-DBD-mysql-4.014-1.el5.rf.x86_64
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by (installed) perl-DBD-mysql-4.014-1.el5.rf.x86_64
mysql is needed by (installed) perl-DBD-mysql-4.014-1.el5.rf.x86_64
4) SO I remove everything that is getting in my way.
# rpm -e mysql-5.0.77-3.el5 perl-DBD-mysql-4.014-1.el5.rf.x86_64 mysql-mmm-agent-2.2.1-1.el5.noarch
5) And now I am all set to install the shiny new MySQL version
# time rpm -ivh MySQL-client-community-5.1.52-1.rhel5.x86_64.rpm MySQL-server-community-5.1.52-1.rhel5.x86_64.rpm
6) Make sure it is installed
# rpm -qa | grep -i mysql
MySQL-server-community-5.1.52-1.rhel5
mysql-mmm-2.2.1-1.el5
MySQL-client-community-5.1.52-1.rhel5
7) Use the mysql_upgrade command to update the user tables. If your mysql.proc table gets corrupted due to any reason (for e.g. while trying to install 5.0 dump), use the following:
mysql_upgrade -f
This will forcefully fix the privilege tables. The 5.0 dump can be imported using the same -f (force) option as well. For e.g.
mysql -uroot -proot@123 -f < /home/today.sql
_____
Installing 5.0 version of mysql is easy.
# check what is installed
# rpm -qa | grep mysql-*
mysql-5.0.77-4.el5_4.2
mysql-5.0.77-4.el5_4.2
mod_auth_mysql-3.0.0-3.2.el5_3
# remove any conflicting version of mysql
# rpm -e mysql-5.0.77-4.el5_5.3.x86_64 --nodeps
# install using yum
# yum install mysql-*
Setting up Install Process
Package mysql-5.0.77-4.el5_4.2.x86_64 already installed and latest version
Package mysql-5.0.77-4.el5_4.2.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package mysql-bench.x86_64 0:5.0.77-4.el5_4.2 set to be updated
=
Install 16 Package(s)
Update 5 Package(s)
Remove 0 Package(s)
Total size: 27 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : krb5-libs 1/26
Installing : perl-DBD-MySQL 2/26
Installing : mysql-server 3/26
Updating : libsepol 4/26
Cleanup : libsepol 24/26
Cleanup : krb5-workstation 25/26
Cleanup : krb5-libs 26/26
Installed:
mysql-bench.x86_64 0:5.0.77-4.el5_4.2 mysql-connector-odbc.x86_64 0:3.51.26r1127-1.el5 mysql-devel.i386 0:5.0.77-4.el5_4.2 mysql-devel.x86_64 0:5.0.77-4.el5_4.2
mysql-server.x86_64 0:5.0.77-4.el5_4.2 mysql-test.x86_64 0:5.0.77-4.el5_4.2
Dependency Installed:
e2fsprogs-devel.x86_64 0:1.39-23.el5 keyutils-libs-devel.x86_64 0:1.2-1.el5 krb5-devel.x86_64 0:1.6.1-36.el5_4.1 libselinux-devel.x86_64 0:1.33.4-5.5.el5
libsepol-devel.x86_64 0:1.15.2-3.el5 libtool-ltdl.x86_64 0:1.5.22-7.el5_4 openssl-devel.x86_64 0:0.9.8e-12.el5_4.6 perl-DBD-MySQL.x86_64 0:3.0007-2.el5
unixODBC.x86_64 0:2.2.11-7.1 zlib-devel.x86_64 0:1.2.3-3
Dependency Updated:
krb5-libs.i386 0:1.6.1-36.el5_4.1 krb5-libs.x86_64 0:1.6.1-36.el5_4.1 krb5-workstation.x86_64 0:1.6.1-36.el5_4.1 libsepol.i386 0:1.15.2-3.el5
libsepol.x86_64 0:1.15.2-3.el5
Complete!
# start mysql
# /etc/init.d/mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h vishnuvm7.hyd.wc password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting MySQL: [ OK ]
[root@vishnuvm7 shantanu]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
# rpm -qa | grep -i mysql-*
mysql-5.0.77-4.el5_4.2
mysql-server-5.0.77-4.el5_4.2
mysql-test-5.0.77-4.el5_4.2
mysql-bench-5.0.77-4.el5_4.2
mysql-5.0.77-4.el5_4.2
perl-DBD-MySQL-3.0007-2.el5
mod_auth_mysql-3.0.0-3.2.el5_3
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-devel-5.0.77-4.el5_4.2
mysql-devel-5.0.77-4.el5_4.2
Labels: mysql tips