Download the MySQL installation package and note the number of system bits.
Cd/usr/local/src
wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-i686-glibc23.tar.gz
Unpack the installation package:
Tar zxvf mysql-5.1.73-linux-i686-glibc23.tar.gz
Initialization
Useradd-s/sbin/nologin-m MySQL
MV Mysql-5.1.73-linux-i686-glibc23/usr/local/mysql
Mkdir-p/data/mysql
Chown-r Mysql/data/mysql
/usr/local/mysql
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
echo $? or appear OK
Copy configuration files and startup scripts
Cd/usr/local/mysql/support-files
CP MY-LARGE.CNF/ETC/MY.CNF
VIM/ETC/MY.CNF//Edit or modify, note the following.
Log-bin=mysql-bin
Binlog_format=mixed
Server-id = 1
Startup file:
Cd/usr/local/mysql/support-files
CP Mysql.server/etc/init.d/mysqld
Vim/etc/init.d/mysqld//Edit or modify
Basedir=/usr/local/mysql
Datadir=/data/mysql
Chkconfig--add mysqld
Chkconfig mysqld on
/etc/init.d/mysqld start
To view a process:
PS aux |grep mysqld
NETSTAT-NLP |grep mysqld
Change the path/usr/local/mysql/bin/mysql/usr/bin/mysql of MySQL
Create user mysqladmin-uroot password 12345 user login mysql-uroot-p12345
installing MySQL under CentOS