Download MySQL to/usr/local/src/
cd/usr/local/src/
wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
Extract
[Email protected] src]# tar zxvf/usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
Move the extracted data to the/usr/local/mysql
[Email protected] src]# MV Mysql-5.1.40-linux-i686-icc-glibc23/usr/local/mysql
Build MySQL User
[[email protected] src]# useradd-s/sbin/nologin MySQL
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/mysql
--userdefine the owner of the database, --datadir define where the database is installed, and it is recommended to place it on a partition of large space, which needs to be created on its own. This step is critical if you see two "OK" instructions to execute correctly.
I've had a problem here before.
It is. Can't find the file. And then I hit a RMP bag.
yum-y Install Libaio libaio-devel
Copy configuration file
[email protected] mysql]# CP support-files/my-large.cnf/etc/my.cnf
Copy the startup script file and modify its properties
[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld
[Email protected] mysql]# chmod 755/etc/init.d/mysqld
modifying startup scripts
[Email protected] mysql]# Vim/etc/init.d/mysqld
There are "Datadir=/data/mysql" where modifications are required (the directory defined when the database was previously initialized)
Add the startup script to the system service entry and set the boot start to start MySQL
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig mysqld on
[[Email protected] mysql]# service mysqld start
If not, please check the error log under/data/mysql/, which is usually the hostname. Err. The command to check if MySQL starts is:
[[Email protected] mysql]# PS aux |grep mysqld
This article is from the "Aming-linux Learning" blog, so be sure to keep this source http://937174156.blog.51cto.com/8141519/1725623
Linux configuration MySQL resolution encountered a new problem two.