(a)下载mysqld源码并解压cd /usr/local/src;wget wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz;tar zxvf /usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz;(b)迁移mysql至/usr/local目录并重命名mv /usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23 /usr/local/mysql;(c)创建mysql用户useradd -M -s /sbin/nologin mysql;(d)创建/data/mysql目录,并更改属组及属主chown -R mysql:mysql /data/mysql;(e)安装mysql./scripts/mysql_install_db --user=mysql --datadir=/data/mysql;(f)拷贝配置文件及修改cp support-files/my-large.cnf /etc/my.cnf;sed -i '/^\[mysqld\]$/a\datadir = /data/mysql' /etc/my.cnf;(g)拷贝启动文件及更改权限cp support-files/mysql.server /etc/init.d/mysqld;sed -i 's#^datadir=#datadir=/data/mysql#'/etc/init.d/mysqld;chmod 755 /etc/init.d/mysqld;