MySQL 5.5 on Debian

# aptitude install libaio-dev libaio1

# cd /usr/src
# wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.21-debian5.0-x86_64.deb/from/http://mysql.oss.eznetsols.org/
# dpkg -i ysql-5.5.21-debian5.0-x86_64.deb
# ln -s /opt/mysql/server-5.5 /usr/local/mysql
# ln -s /opt/mysql/server-5.5/bin/* /usr/local/bin/
# cp /opt/mysql/server-5.5/support-files/my-medium.cnf /etc/mysql/my.cnf
# ln -s /etc/mysql/my.cnf /etc/my.cnf
# nano /etc/mysql/my.cnf

[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysql.sock
user = root
basedir = /usr/local/mysql
datadir = /var/lib/mysql
tmpdir = /tmp
log_error = /var/log/mysql.err
skip-external-locking
….

# cp /opt/mysql/server-5.5/support-files/mysql.server /etc/init.d/mysql
# chmod +x /etc/init.d/mysql
# update-rc.d mysql defaults
# mkdir /var/lib/mysql
# cd /opt/mysql/server-5.5/scripts/
# ./mysql_install_db –user=root –ldata=/var/lib/mysql/
# /etc/init.d/mysql start
# /usr/local/mysql/bin/mysqladmin -u root password ‘newpassword’

## test
# mysql -u root -p

## finalize
# mysql_upgrade -u root -p

source:
http://www.badllama.com/comment/1
https://wiki.archlinux.org/index.php/MySQL