MySQL Installation--free compilation installation
Download MySQL free compile package first
http://mirrors.sohu.com/
The MySQL installation.
1) How many bits of the system are required to install MySQL.
Uname-a to see if the system is 32-bit or 64-bit.
2. Basically download the free compiler package placed under/usr/local/src/
1.cd/usr/local/src/
wget http://mirrors.sohu.com/mysqlMYSQL-5.1/mysql-5.1.73-linux-i686-glibc23.tar.gz
When an error occurs,
Yum install-y wget
2. After the current download, unzip
1.1
#tar zxvf/usr/local/src/mysql-5.1.73-linux-i686-glibc23.tar.gz
1.2
#mv/usr/local/src/mysql-5.1.73-linux-i686-glibc23.tar.gz/usr/local/mysql Move Rename
1.3
#useradd-S/sbin/nologin-m mysql create MySQL and disable login, do not generate home directory.
1.4
#mkdir-P/data/mysql
1.5
#chown-R Mysql/data/mysql
1.6
#cd/usr/local/mysql
#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql Initialization
When you are done
echo $? When the return value is 0 o'clock, it indicates that initialization is normal. It is not normal with numbers.
3. Configure MySQL
CP support-file/my-large.cnf/etc/my.cnf Copy configuration file Rename
CP Support-file/mysql.server/etc/init.d/mysqld
chmod 755/etc/init.d/msqld
4. Modify the startup script.
Vim/etc/init.d/mysqld
Put Datadir=/data/mysql
Put Basedir=/usr/local/mysql
: Wq
Chkconfig-add MySQL
Chkconfig mysqld on
/etc/init.d/mysqld Start or service mysqld start
When there's a problem.
You can view the error log for data/mysql/.
Typically, this file is the hostname. err
5. Check to see if it is turned on
PS aux |grep mysqld
NETSTAT-LNP |mysqld
This article from the "Linux Learning Space" blog, reproduced please contact the author!
Installation method of MySQL in the prelude to lamp construction