(1) Download MySQL to/usr/local/src/directory
Cd/usr/local/src/wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
(2) Unzip and move the extracted data to/usr/local/mysql (this step is to move and rename, not to move the data into this directory, itself this directory does not exist)
[Email protected] src]# tar zxvf/usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
[Email protected] src]# MV Mysql-5.1.40-linux-i686-icc-glibc23/usr/local/mysql
(3) Build MySQL user
[[email protected] src]# useradd-s/sbin/nologin-m MySQL
(4) Initializing the database
[Email protected] src]# cd/usr/local/mysql [[email protected] mysql]# mkdir-p/data/mysql; Chown-r Mysql:mysql/data/mysql [[email protected] mysql]#./scripts/mysql_install_db--user=mysql--datadir=/data/m Ysql
(5) Copy the configuration file and start the script and modify its properties
[email protected] mysql]# CP support-files/my-large.cnf/etc/my.cnf
[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld [[email protected] mysql]# chmod 755/et C/init.d/mysqld
(6) Modifying the startup script
[Email protected] mysql]# Vim/etc/init.d/mysqld
There are "Datadir=/data/mysql" and "Basedir=/usr/local/mysql" where modifications are required (DataDir is the directory defined when the database was previously initialized)
(7) Add the startup script to the system service item, and set the boot start, start MySQL
[[email protected] mysql]# chkconfig--add mysqld[[email protected] mysql]# chkconfig mysqld on[[email protected] mysql]# Service mysqld Start
(8) if it does not start, please check the error log under/data/mysql/, this log is usually the hostname. Err. The command to check if MySQL is started is:
[[Email protected] mysql]# PS aux |grep mysqld
This article is from the "7169431" blog, please be sure to keep this source http://7179431.blog.51cto.com/7169431/1878151
MySQL installation (binary compiler-free installation)