How I got MySQL 5.5 running on Ubuntu 10.04 Server

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/