1

I am trying to install Mysql 5.1 on cent OS. I researched a lot but could not find any link which gives step by step procedure. Everywhere, there are vague answers. Can someone please give me steps to be followed to install Mysql 5.1 ?

4
  • I would strongly recommend installing MySQL 5.5.20 over 5.1.34 because of the number of improvements. Is there any particular reason for wanting MySQL 5.1.34? Commented Feb 24, 2012 at 19:21
  • The reason is we are deploying our DB on Amazon and we already have another machine which uses Mysql 5.1.34. The data is too big to transfer and cannot have downtime to upgrade other machine either.
    – vinny
    Commented Feb 24, 2012 at 19:31
  • OK I supplied the download and install steps for both. These are scripts I still use today. Commented Feb 24, 2012 at 19:33
  • There is no compelling reason to use 5.1.34. The latest 5.1 release is 5.1.61 and should be backwards compatible with 5.1.34. Commented Feb 24, 2012 at 20:30

3 Answers 3

4

While I would normally not recommend this

To download and install MySQL 5.1.34, run these commands at your Linux prompt AS IS...

MYSQL_VERSION=5.1
MYSQL_VERSION_RELNUM=34
MYSQL_VERSION_RELEASE=${MYSQL_VERSION}.${MYSQL_VERSION_RELNUM}
REDHAT_RELEASE=5
BINARY_VERSION=x86_64
PERL_LOCATION=ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages
PERL_FILE=perl-DBI-1.53-2.fc7.x86_64.rpm
PERL_URL=${PERL_LOCATION}/${PERL_FILE}
MYSQL_MIRROR_INDEX=0
MYSQL_SHARE2_LIB=MySQL-shared-compat-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SHARED_LIB=MySQL-shared-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_DEVEL__LIB=MySQL-devel-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_CLIENT_LIB=MySQL-client-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SERVER_LIB=MySQL-server-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SHARE2_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARE2_LIB}"
MYSQL_SHARED_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARED_LIB}"
MYSQL_DEVEL__URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_DEVEL__LIB}"
MYSQL_CLIENT_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_CLIENT_LIB}"
MYSQL_SERVER_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SERVER_LIB}"
cd
rm -rf MySQLInstall
mkdir  MySQLInstall
cd     MySQLInstall
wget ${PERL_URL}
wget ${MYSQL_SHARE2_URL}
wget ${MYSQL_SHARED_URL}
wget ${MYSQL_DEVEL__URL}
wget ${MYSQL_CLIENT_URL}
wget ${MYSQL_SERVER_URL}
pwd
ls -l
rpm -Uvh --force ${PERL_FILE}
rpm -Uvh --force ${MYSQL_SHARE2_LIB}
rpm -Uvh --force ${MYSQL_SHARED_LIB}
rpm -Uvh --force ${MYSQL_DEVEL__LIB}
rpm -Uvh --force ${MYSQL_CLIENT_LIB}
rpm -Uvh --force ${MYSQL_SERVER_LIB}

To go get the Latest Version of MySQL, run these AS IS...

HOWMANYBITS=64
WHATOS=5
BINARY_VERSION=000
if [ ${HOWMANYBITS} -eq 32 ] ; then BINARY_VERSION=i386   ; fi
if [ ${HOWMANYBITS} -eq 64 ] ; then BINARY_VERSION=x86_64 ; fi
MINOR_RELEASE=20
MYSQL_RELEASE=5.5.${MINOR_RELEASE}
OS_VERSION=000
if [ ${WHATOS} -eq 0 ] ; then OS_VERSION=linux2.6 ; fi
if [ ${WHATOS} -eq 5 ] ; then OS_VERSION=rhel5    ; fi
RELEASE_TAG=1
DEVEL__RPM=http://www.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SHARD2_RPM=http://www.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-compat-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SHARED_RPM=http://www.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
CLIENT_RPM=http://www.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SERVER_RPM=http://www.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
PERL_LOCATION=ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages
PERL_FILE=perl-DBI-1.53-2.fc7.x86_64.rpm
PERL_URL=${PERL_LOCATION}/${PERL_FILE}
cd
rm -rf MySQL5.5_Install
mkdir MySQL5.5_Install
cd MySQL5.5_Install
wget ${PERL_URL}
wget ${DEVEL__RPM}
wget ${SHARD2_RPM}
wget ${SHARED_RPM}
wget ${CLIENT_RPM}
wget ${SERVER_RPM}
ls -l
for RPM in `ls -lSr *.rpm | awk '{print $9}'` ; do rpm -Uvh --force ${RPM} ; done

CAVEAT

When running the download for MySQL 5.1.34, if the RPMs for the MySQL Binaries do not get retrieved, change this line

MYSQL_MIRROR_INDEX=0

to

MYSQL_MIRROR_INDEX=1

One value or the other will work.

UPDATE 2012-02-24 14:35 EDT

I just tried getting MySQL 5.1.34 (I skipped the install part) and I got this

[redwards@lw-lts-155 MySQLInstall]$ MYSQL_VERSION=5.1
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_VERSION_RELNUM=34

[redwards@lw-lts-155 MySQLInstall]$ MYSQL_VERSION_RELEASE=${MYSQL_VERSION}.${MYSQL_VERSION_RELNUM}
[redwards@lw-lts-155 MySQLInstall]$ REDHAT_RELEASE=5
[redwards@lw-lts-155 MySQLInstall]$ BINARY_VERSION=x86_64
[redwards@lw-lts-155 MySQLInstall]$ PERL_LOCATION=ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages
MYSQL_SERVER_LIB=MySQL-server-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SHARE2_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARE2_LIB}"
MYSQL_SHARED_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARED_LIB}"
MYSQL_DEVEL__URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_DEVEL__LIB}"
[redwards@lw-lts-155 MySQLInstall]$ PERL_FILE=perl-DBI-1.53-2.fc7.x86_64.rpm
[redwards@lw-lts-155 MySQLInstall]$ PERL_URL=${PERL_LOCATION}/${PERL_FILE}
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_MIRROR_INDEX=0
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SHARE2_LIB=MySQL-shared-compat-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SHARED_LIB=MySQL-shared-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_DEVEL__LIB=MySQL-devel-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_CLIENT_LIB=MySQL-client-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SERVER_LIB=MySQL-server-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SHARE2_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARE2_LIB}"
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SHARED_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SHARED_LIB}"
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_DEVEL__URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_DEVEL__LIB}"
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_CLIENT_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_CLIENT_LIB}"
[redwards@lw-lts-155 MySQLInstall]$ MYSQL_SERVER_URL="http://downloads.mysql.com/archives/mysql-${MYSQL_VERSION}/${MYSQL_SERVER_LIB}"
[redwards@lw-lts-155 MySQLInstall]$ cd
[redwards@lw-lts-155 ~]$ rm -rf MySQLInstall
[redwards@lw-lts-155 ~]$ mkdir  MySQLInstall
[redwards@lw-lts-155 ~]$ cd     MySQLInstall
[redwards@lw-lts-155 MySQLInstall]$ wget ${PERL_URL}
--2012-02-24 14:26:08--  ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages/perl-DBI-1.53-2.fc7.x86_64.rpm
           => `perl-DBI-1.53-2.fc7.x86_64.rpm'
Resolving ftp.de.netclusive.de... 89.110.128.25
Connecting to ftp.de.netclusive.de|89.110.128.25|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/parallels/Plesk/Expand/2.3.1/packages ... done.
==> SIZE perl-DBI-1.53-2.fc7.x86_64.rpm ... 625843
==> PASV ... done.    ==> RETR perl-DBI-1.53-2.fc7.x86_64.rpm ... done.
Length: 625843 (611K)

100%[=============================================================================================================================>] 625,843      767K/s   in 0.8s

2012-02-24 14:26:10 (767 KB/s) - `perl-DBI-1.53-2.fc7.x86_64.rpm' saved [625843]

[redwards@lw-lts-155 MySQLInstall]$ wget ${MYSQL_SHARE2_URL}
--2012-02-24 14:26:10--  http://downloads.mysql.com/archives/mysql-5.1/MySQL-shared-compat-5.1.34-0.rhel5.x86_64.rpm
Resolving downloads.mysql.com... 156.151.63.14
Connecting to downloads.mysql.com|156.151.63.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5058961 (4.8M) [application/octet-stream]
Saving to: `MySQL-shared-compat-5.1.34-0.rhel5.x86_64.rpm'

100%[=============================================================================================================================>] 5,058,961    518K/s   in 9.7s

2012-02-24 14:26:21 (512 KB/s) - `MySQL-shared-compat-5.1.34-0.rhel5.x86_64.rpm' saved [5058961/5058961]

[redwards@lw-lts-155 MySQLInstall]$ wget ${MYSQL_SHARED_URL}
--2012-02-24 14:26:22--  http://downloads.mysql.com/archives/mysql-5.1/MySQL-shared-community-5.1.34-0.rhel5.x86_64.rpm
Resolving downloads.mysql.com... 156.151.63.14
Connecting to downloads.mysql.com|156.151.63.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1827818 (1.7M) [application/octet-stream]
Saving to: `MySQL-shared-community-5.1.34-0.rhel5.x86_64.rpm'

100%[=============================================================================================================================>] 1,827,818    487K/s   in 3.7s

2012-02-24 14:26:26 (487 KB/s) - `MySQL-shared-community-5.1.34-0.rhel5.x86_64.rpm' saved [1827818/1827818]

[redwards@lw-lts-155 MySQLInstall]$ wget ${MYSQL_DEVEL__URL}
--2012-02-24 14:26:26--  http://downloads.mysql.com/archives/mysql-5.1/MySQL-devel-community-5.1.34-0.rhel5.x86_64.rpm
Resolving downloads.mysql.com... 156.151.63.14
Connecting to downloads.mysql.com|156.151.63.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8693623 (8.3M) [application/octet-stream]
Saving to: `MySQL-devel-community-5.1.34-0.rhel5.x86_64.rpm'

100%[=============================================================================================================================>] 8,693,623    512K/s   in 17s

2012-02-24 14:26:46 (511 KB/s) - `MySQL-devel-community-5.1.34-0.rhel5.x86_64.rpm' saved [8693623/8693623]

[redwards@lw-lts-155 MySQLInstall]$ wget ${MYSQL_CLIENT_URL}
--2012-02-24 14:26:46--  http://downloads.mysql.com/archives/mysql-5.1/MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm
Resolving downloads.mysql.com... 156.151.63.14
Connecting to downloads.mysql.com|156.151.63.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7515446 (7.2M) [application/octet-stream]
Saving to: `MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm'

100%[=============================================================================================================================>] 7,515,446    501K/s   in 15s

2012-02-24 14:27:03 (497 KB/s) - `MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm' saved [7515446/7515446]

[redwards@lw-lts-155 MySQLInstall]$ wget ${MYSQL_SERVER_URL}
--2012-02-24 14:27:03--  http://downloads.mysql.com/archives/mysql-5.1/MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm
Resolving downloads.mysql.com... 156.151.63.14
Connecting to downloads.mysql.com|156.151.63.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20053095 (19M) [application/octet-stream]
Saving to: `MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm'

100%[=============================================================================================================================>] 20,053,095   506K/s   in 42s

2012-02-24 14:27:46 (462 KB/s) - `MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm' saved [20053095/20053095]

[redwards@lw-lts-155 MySQLInstall]$ pwd
/home/lw-staff/redwards/MySQLInstall
[redwards@lw-lts-155 MySQLInstall]$ ls -l
total 42832
-rw-r--r-- 1 redwards users  7515446 Apr  7  2009 MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm
-rw-r--r-- 1 redwards users  8693623 Apr  7  2009 MySQL-devel-community-5.1.34-0.rhel5.x86_64.rpm
-rw-r--r-- 1 redwards users 20053095 Apr  7  2009 MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm
-rw-r--r-- 1 redwards users  1827818 Apr  7  2009 MySQL-shared-community-5.1.34-0.rhel5.x86_64.rpm
-rw-r--r-- 1 redwards users  5058961 Apr  7  2009 MySQL-shared-compat-5.1.34-0.rhel5.x86_64.rpm
-rw-r--r-- 1 redwards users   625843 Feb 24 14:26 perl-DBI-1.53-2.fc7.x86_64.rpm

Keep in mind that the MySQL Binaries are three years old

2
  • Thank you so much for such an explanatory answer. So, after having all these steps performed, I will have a Mysql running on that machine right?
    – vinny
    Commented Feb 24, 2012 at 19:44
  • 1
    Yes, because the server RPM for MySQL 5.1 will automatically startup mysql upon installation. Commented Feb 24, 2012 at 19:45
1
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm
sudo rpm -Uvh MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm
sudo rpm -Uvh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm
sudo service mysql start
mysql_secure_installation

For other versions just go to http://dev.mysql.com/downloads/mysql/5.1.html and download the client and server.

0

Step 1 login as root to your vps

Step 2 Install Remi repository

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm The result will something like.. Retrieving http://rpms.famillecollet.com/enterprise/remi-release-5.rpm warning: /var/tmp/rpm-xfer.cVJJxn: Header V3 DSA signature: NOKEY, key ID 00f97f56 Preparing... ########################################### [100%] 1:remi-release ########################################### [100%]

Step 3 Check availability of MySQL versions

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

the last lines of the output should be something like this.

Available Packages mysql.i386 5.5.14-1.el5.remi remi mysql-server.i386 5.5.14-1.el5.remi remi [root@one ~]#

Step 4 Update or Install MySQL

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

Step 5 Restart MySQL

service mysqld start

Step 6 Upgrade MySQL Databases

mysql_upgrade -u root -p

http://www.techyv.com/questions/install-mysql-51-centos-55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.