Monday, January 27, 2014

Installing MySQL on Oracle Enterprise Linux

Oracle Enterprise Linux comes with MySQL Binaries, which needs to be 
enabled and installed and started. The process is described below.

# Check if already installed
$ rpm -qa | grep -i mysql

# Configure yum repository on new server
$ su -
$ cd /tmp
$ wget http://public-yum.oracle.com/public-yum-el5.repo
$ sed -e "s/enabled=0/enabled=1/" public-yum-el5.repo > /etc/yum.repos.d/public-yum-el5.repo

# Install MySQL
$ yum install -y mysql-server mysql

# Start and test MySQL Instance
$ /etc/init.d/mysqld start
$ mysql -uroot -e "SELECT VERSION()"

+-----------+
| VERSION() |
+-----------+
| 5.0.77    |
+-----------+



How to check Oracle Enterprise Linux Version

$rpm -qf /etc/redhat-release
enterprise-release-5-0.0.2

There are other methods too:

# cat /proc/version
Linux version 2.6.18-274.7.1.0.1.el5 (...) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51))
A bit more reliable seems to be /etc/issue or /etc/issue.net
# cat /etc/issue.net | head -1
Oracle Linux Server release 5.7