#useradd mysql -s /sbin/nologin
#wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.54.tar.gz
#tar zxvf mysql-5.1.54.tar.gz
#cd mysql-5.1.54
#./configure --prefix=/usr/local/mysql
--with-mysqld-ldflags=-all-static //以靜態方式編譯服務器端
--with-client-ldflags=-all-static //以靜態方式編譯客戶端
--with-extra-charset=utf8,gbk //添加utf8、gbk字符集
--with-plugins=innobase,myisam //添加mysql存儲引擎
--with-server-suffix=-community //為mysqld版本字符串添加後綴
--with-unix-socket-path=/usr/local/mysql/sock/mysql.sock
--enable-thread-safe-client //以線程方式編譯客戶端,提高性能
--enable-assembler //使用匯編,提高性能
--enable-profiling //啟用profile功能
--without-embedded-server //去除embedded
--without-debug //去除debug模式,提高性能
--without-bench //去除bench模式,提高性能
#make && make install
#cp support-files/my-medium.cnf /etc/my.cnf #chown -R mysql:mysql /usr/local/mysql
#/usr/local/mysql/bin/mysql_install_db --user=mysql & //初始化mysql
#/usr/local/mysql/bin/mysqld_safe --user=mysql & //啟動mysql
#/usr/local/mysql/bin/mysqladmin -uroot password 123456 //設置mysql管理員密碼
#echo "/usr/local/mysql/bin/mysqld_safe --user=mysql &" >>/etc/rc.local //加入開機自啟動
#echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile //加入環境變量
#source /etc/profile
作者“崔元榮學技術”