Home > General Articles, mysql > How I got MySQL 5.5 running on Ubuntu 10.04 Server

How I got MySQL 5.5 running on Ubuntu 10.04 Server

August 2nd, 2011 Leave a comment Go to comments

After referring to all sort of documents online, for getting the src deb and compiling, which always created one or other method of headaches for me, we approached the Oracle recommended method. Downloaded the binary from official oracle downloads. In the actual process I just deviated here and there to suit my preferences. Untarred the binary to /opt/mysql-5.5.15-linux2.6-x86_64, soft linked to this from /usr/local/mysql.

After creating the /etc/my.cnf to my desired settings, I proceeded with the mysql_install_db, which promptly failed complaining about a libaio. Again a bit of googling, found the answer ‘apt-get install libaio1′. Okay the install db went straight. Now the startup script. Copied the script [mysql-base-dir]/support-files/mysql.server to /etc/init.d/mysql. Issued update-rc.d mysql defaults. All was well, the server started smoothly. But Ubuntu did not have path spec for finding the binaries, so did the easy way ln -s /usr/local/mysql/bin/* /usr/bin/. Since we were using the Ubuntu stock mysql-server and client for a long time, most of our shell scripts also expect the same path.

More or less the whole bunch of commands are as follows, I have rearranged a bit to avoid the errors which I faced.

apt-get install libaio1

groupadd mysql
useradd -r -g mysql mysql

cd /opt
tar zxf ~/mysql-5.5.15-linux2.6-x86_64.tar.gz
ln -s  /opt/mysql-5.5.15-linux2.6-x86_64 /usr/local/mysql
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/sql/mysql --user=mysql
chown -R root /opt/mysql-5.5.15-linux2.6-x86_64
chown -R mysql /sql/mysql
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql.server
ln -s /usr/local/mysql/bin/* /usr/bin/

Categories: General Articles, mysql Tags:
  1. Andrey
    August 16th, 2011 at 01:05 | #1

    hi, i did basically same thing. But what about Your PHP MySQL library version 5.0.32 (default ubuntu) differs from your MySQL server version 5.5.15. This may cause unpredictable behavior. I cant find php library to replace. Have you had any DB problems?

  2. Bojangles
    August 30th, 2011 at 10:19 | #2

    Just to correct something here:

    /usr/local/mysql/scripts/mysql_install_db –base-dir=/usr/local/mysql –data-dir=/sql/mysql –user=mysql

    should be:

    /usr/local/mysql/scripts/mysql_install_db –basedir=/usr/local/mysql –datadir=/sql/mysql –user=mysql

  3. September 7th, 2011 at 07:58 | #3

    @Andrey
    Nope.. did a recompile of php and it was working fine

  4. September 7th, 2011 at 07:59 | #4

    @Bojangles
    Yes.. it should be, thanks for pointing out. The post is updated now.

  5. abdullah
    September 9th, 2011 at 16:13 | #5

    i am trying to install mysql from binary dist. i.e mysql-5.5.15-linux2.6-i686.tar.gz
    on ubuntu 10.04 ,I am getting problems when executing command
    /scripts/mysql_install_db –user=mysql

    plz help
    i tried much but still help less

  6. September 10th, 2011 at 08:58 | #6

    @abdullah
    could you post the errors you are getting

  1. No trackbacks yet.

+ eight = eleven