Build your own database driven website by Kevin Yank -mysql installation problems

Hello I’m starting to read the book by Mr Kevin Yank Build your Own Database driven website, I’ve also purchased the PHP Live course -I and I decided to follow the individual packages installation procedure (I’ve had no problems with WAMP or XAMPP in the past) but I wanted to learn more about MySQL PHP and Apache.

I’m trying to install MySQL on a fresh Ubuntu 11.04 installation:

everything ran smoothly untill the step described on page 20 for installing mysql’s database files with the following command:

root@machine:/usr/local/mysql# scripts/mysql_install_db --user=mysql

mysql returned an error telling that it could’t find an .so file I don’t remember the file right now but I did a search on the web and installed it via apt-get install then I repeated the command above and the database files were installed.

then I started mysql for the first time with the command provided by Mr Yank and got the following error:

root@LIP-Y550:/usr/local/mysql# bin/mysqld_safe --user=mysql &
[1] 3214
root@LIP-Y550:/usr/local/mysql# 110803 04:10:14 mysqld_safe Logging to ‘/var/log/mysql/error.log’.
touch: cannot touch /var/log/mysql/error.log': No such file or directory chown: cannot access /var/log/mysql/error.log’: No such file or directory
110803 04:10:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
bin/mysqld_safe: 739: cannot create /var/log/mysql/error.log: Directory nonexistent
eval: 1: cannot create /var/log/mysql/error.log: Directory nonexistent
110803 04:10:14 mysqld_safe mysqld from pid file /var/lib/mysql/ ended
bin/mysqld_safe: 783: cannot create /var/log/mysql/error.log: Directory nonexistent
[1]+ Exit 2 bin/mysqld_safe --user=mysql

then I tried to test if the server was running (I din’t thought so) but I tried

root@LIP-Y550:/usr/local/mysql# bin/mysqladmin -u root status

and got:

bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’
Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!

there is no hostname.err file on mysql data directory to check what on earth went wrong.

I don’t know if just reinstalling everything -by following the installation steps would be of any use, I decided to ask here for help prior to attempting that.

I did double checked every command when doing the installation for the first time so I’m positive I followed every instruction.

thanks in advanced I hope someone can help me.
Oh I’m installing MySQL 5.5.15-Linux2.6-x86_64.tar.gz (I’m on Ubuntu 64 bits)

UPDATE: I’ve found the note I took of the error thown at me in the first attempt of creating its database:

mysqld: error while loading shared libraries: cannot open shared object file: No such file or directory

I Fixed after installing libaio1: sudo apt-get install libaio1