安裝版本MySQL-5.0.40 需編譯
下載編譯需要的一些工具,這些工具在默認安裝的ubuntu上可能沒有,需要手動安裝
sudo apt-get install g++ gcc make automake perl
安裝好所有需要的工具
下載需要的libncurses5-dev、kdelibs_dev 和 kdelib
sudo apt-get update
apt-get install build-essential
sudo apt-get install libncurses5-dev
sudo apt-get install kdelibs4-dev
sudo apt-get install kdelibs4c2a
安裝MySQL,使用root權限
shell> groupadd MySQL
shell> useradd -g mysql MySQL
shell> gunzip < MySQL-VERSION.tar.gz | tar -xvf -
shell> cd MySQL-VERSION
shell> ./configure --prefix=/usr/local/MySQL
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/MySQL
shell> chown -R MySQL .
shell> chgrp -R MySQL .
shell> bin/mysql_install_db --user=MySQL
shell> chown -R root .
shell> chown -R MySQL var
shell> bin/mysqld_safe --user=MySQL &