Install dependent packages
Yum-y install make gcc-c++ cmake bison-devel ncurses-devel perl*
Upload MySQL Compressed package locally
Put mysql-5.6.16.tar.gz
Tar XF mysql-5.6.16.tar.gz
CD mysql-5.6.16
CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-DSYSCONFDIR=/ETC \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-dmysql_unix_addr=/var/lib/mysql/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-dwith_partition_storage_engine=1 \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
Make && make install
Groupadd MySQL
useradd-g MySQL MySQL
Chown-r Mysql:mysql/usr/local/mysql
Initializing MySQL Database
Cd/usr/local/mysql
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
CP Support-files/mysql.server/etc/init.d/mysqld
Chkconfig mysqld on
Fill in the data storage path, do not write may cause the database to fail to start
Vim/etc/my.cnf
Datadir=/usr/local/mysql/data
: Wq
Service mysqld Start
adding paths to Path
Vim/etc/profile
Path=/usr/local/mysql/bin: $PATH
Export PATH
Source/etc/profile
Service mysqld Start
Mysql-uroot
Set a password for the database root user
mysql> SET PASSWORD = PASSWORD (' 123456 ');
Set the password for the remote login MySQL database
Mysql> GRANT All privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
Exit, to this MySQL compile installation end
This article refers to the link: http://blog.csdn.net/wendi_0506/article/details/39478369
This article is from my Little Paradise blog, so be sure to keep this source http://9918511.blog.51cto.com/9908511/1639364
mysql5.6.16 Compiling and installing