Wednesday, June 17, 2015

update mysql server from mysql 5.1 to mysql 5.5 on CentOS-6

First, to set up the yum repository, install the webtatic-release RPM based on your CentOS/RHEL release:
Webtatic EL6 for CentOS/RHEL 6.x
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Webtatic EL5.1 for CentOS/RHEL 5.x:
rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
If you already have MySql client or server installed (rpm -q mysql mysql-server), then you can upgrade using the following method:
yum install mysql.`uname -i` yum-plugin-replace
yum replace mysql --replace-with mysql55w
“yum install mysql” is only there to make sure yum-plugin-replace can resolve dependencies correctly if only mysql-server was installed.
Otherwise, to install MySql client and server, then run:
yum install mysql55w mysql55w-server
You should upgrade existing tables before setting the server to become a production machine, which can be done by starting the server and running the mysql_upgrade script (this may take time depending on the size of the database).
service mysqld start
 
# This will issue a password prompt for the user. If you don't have a root user password, remove the "-p"
mysql_upgrade -u root -p

from : https://webtatic.com/packages/mysql55/


another simple command upgrade all packages : yum upgrade




another method


To list Old MySql

yum list installed | grep -i mysql

To remove Old MySql

yum remove mysql mysql-*

Remi Dependency on CentOS 6 and Red Hat (RHEL) 6

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Install MySQL server

yum --enablerepo=remi,remi-test install mysql mysql-server

To list New MySql

yum list installed | grep -i mysql

start MySql server

/etc/init.d/mysqld start ## use restart after update

OR

service mysqld start ## use restart after update
chkconfig --levels 235 mysqld on

Last

mysql_upgrade -u root -p

from : http://stackoverflow.com/questions/9361720/update-mysql-version-from-5-1-to-5-5-in-centos-6-2 




nilo