linux下mysql安装

安装版本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 &