Installing MySQL on Oracle Enterprise Linux

One of the significant benefits of MySQL is it’s ease of use. Generally already installed on most Linux systems, MySQL can be installed by a single command if not yet present. On Oracle Enterprise Linux 5.4 you can use the following commands to check for MySQL, configure your yum repository and install MySQL.

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

# Configure yum repository on new server
$ su -
$ cd /tmp
$ wget
$ 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()"

| 5.0.77    |

You can find more information about the Oracle public yum repository at You will also note that the version installed is 5.0. The current GA version of MySQL is 5.1, however Red Hat is notorious for taking time to update repositories more regularly. You can always use more current rpm files available at the MySQL downloads page.

If you want MySQL to be configured to automatically start and stop on your server you need to run the following command.

$ chkconfig mysqld on
$ chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

You can link to this post with the short url

Related Posts


  1. Paul Parker says

    Being NON-technical… first: do still find your article interesting :-) as a contented user of MySQL to hold data would be interested in reading how to upgrade version of MySQL without loosing our database data.

    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1
    Server version: 5.0.67 SUSE MySQL RPM

  2. bul says

    Hi Ronald;

    Thanks for the article. I am running Windows Server 2003 on my Dell PowerEdge 2850 and men its a mess. A friend says I can install Oracle unbreakable linux on it. My plan is to use it as a mysql dedicated server. Would the steps archive my goal? Thanks


  3. says

    Good post, thanks.

    One remark:

    I think the command to check the version is mysql -u root -e “SELECT VERSION()”
    Without the brackets I get the message #Unknown column ‘VERSION’ in ‘field list’

    Kind regards Lonneke