First create a MySQL database storage directory, it is recommended to create an LVM volume to hold the database files
Mkdir/mysqldata/data
Add MySQL User
Groupadd-r MySQL
Useradd-g mysql-r-s/sbin/nologin-m-d/mysqldata/data MySQL
Modify the owner and host group of the database directory
Chown-r Mysql:mysql/mysqldata/data
Unzip binary Universal Package
Tar XF mysql-5.6.13-linux-glibc2.5-i686.tar.gz-c/usr/local
Cd/usr/local
Create soft links for easy daily management
LN-SV mysql-5.6.13-linux-glibc2.5-i686 MySQL
CD MySQL
Modify all files in the MySQL directory to belong to the master root group MySQL
Chown-r root:mysql/usr/local/mysql/*
Run scripts/mysql_install_db to initialize MySQL, just initialize it on first use
scripts/mysql_install_db--user=mysql--datadir=/mysqldata/data
CD Support-files Directory
4. Provide the main configuration file for MySQL:
CP MY-DEFAULT.CNF/ETC/MY.CNF
You also need to add the location of the specified MySQL data file in my.cnf:
DataDir =/mysqldata/data
Provide SYSV service script for MySQL:
CP Mysql.server/etc/init.d/mysqld
chmod +x/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on
Import Environment variables
Export Path=/usr/local/mysql/bin: $PATH
6, output the MySQL man manual to the man command to find the path:
To edit the/etc/man.config, add the following line:
Manpath/usr/local/mysql/man
Export Header File
Ln-sv/usr/local/mysql/include/usr/include/mysql
Export Library files
Vim/etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib
Save exit
Executive Ldconfig-v | grep MySQL
At this point, MySQL is ready to use.
This article is from the "Please give me a knife" blog, please be sure to keep this source http://lulucao2006.blog.51cto.com/5375246/1552904
Two MySQL universal binary installation in lamp environment