1. download mysql to /usr/local/src/
Cd/usr/local/src
wget http://mirrors.sohu.com/mysql/MySQL-5.4/mysql-5.4.3-beta-linux-i686-glibc23.tar.gz
2. Unzip
Tar zxvf mysql-5.4.3-beta-linux-i686-glibc23.tar.gz
3. move the extracted data to the /usr/local/mysql
MV Mysql-5.4.3-beta-linux-i686-glibc23/usr/local/mysql
4. build mysql users
Useradd-s/sbin/nologin MySQL
5. Initializing the database
Cd/usr/local/mysql
Mkdir-p/data/mysql
Chown-r Mysql:mysql/data/mysql
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
--user defines the owner of the database, the --datadir defines where the database is installed, and it is recommended to place the partition on a large space, which needs to be created on its own. This step is critical if you see two "OK" instructions to perform the correct
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7D/E6/wKiom1byTbbSiR2YAAAZJj6qVTc368.png "title=" Two x ok.png "alt=" Wkiom1bytbbsir2yaaazjj6qvtc368.png "/>
by command echo $? , check the return value and return a value of 0 without problems.
6. Copy the configuration file
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
7. Copy the startup script 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
8. Modify the MySQL startup script
Vim/etc/init.d/mysqld
Modified content:datadir=/data/mysql
/data/mysql is the directory that is defined when the database is initialized.
9. put the boot into the system service like, set boot up, and start MySQL.
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig mysqld on
[[Email protected] mysql]# service mysqld start
Starting MySQL. success!
One. mysql Installation