MySQL compilation is troublesome, directly search for the binary package that can not compile
1. Download Mysql
#cd/USR/LOCAL/SRC
#wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
2 . Decompression
# TAR-XVZF Mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
3.Create mysql account and run MySQL
#useradd-S/sbin/nologin-m MySQL
4. Move and Rename
#mv MySQL 5.1.40-linux-i686-icc-glibc23/usr/local/mysql
5, enter the /usr/local/mysql , create and indicate the user and database directory
#cd/usr/local/mysql; Mkdir-p/data/mysql; Chown-r Mysql:mysql/data/mysql
#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
There are two OK initialization complete.
6. Copy the MySQL configuration file to /etc/my.cnf
#cp/usr/local/mysql/support-files/my-large.cnf/etc/my.cnf
7. Copy Startup script
#cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
chmod 755 mysqld
Vim/etc/init.d/mysqld ====>basedir=/usr/local/mysql Datadir=/data/mysql
8. Join the boot and start
#chkconfig--add mysqld; Chkconfig--level mysqld on
#netstat-LNP | grep mysqld
This article from "Lamp Environment Build" blog, declined reprint!
installation of MySQL under lamp environment