debian需要安裝libaio
apt-get install libaio1
然後輸入命令
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
這裡我用的這句:scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
shell> chown -R root .
shell> chown -R mysql data
shell> cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf # Option
這裡需要修改innodb設置
shell> bin/mysqld_safe --user=mysql &
shell> cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql.server # Optional
這裡設置
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
最後開機自啟動
update-rc.d mysql.server defaults