First, prepare the compilation environment,Install required dependencies

yum groupinstall "development" -y

yum install openssl openssl-devel zlib zlib-devel -y

yum install readline-devel pcre-devel ncurses-devel bison-devel cmake -y

Compile and install

1. Use cmake to compile, cmake compiles in a different way than make, as follows:



./configure --help



cmake .-lh or ccmake.

2.Compile options

Commonly used options for specifying the installation path

-dcmake_install_prefix =/usr/local/mysql

-dmysql_datadir =/data/mysql

-dsysconfdir =/etc

Storage engine configuration:





To explicitly specify that an engine is not compiled,You can use a command similar to the following:


To compile other functions,Such as ssl, you can use the following options to achieve a certain function or not used during compilation:





Other common options:


-dmysql_unix_addr =/tmp/mysql.sock







Specific compilation options can refer to the official documentation

To clean up the generated files, use the make clean command

After compiling, you can make&&make install

Third, configure mysql

1. Provide an account for mysql,Run processes in a secure way,Modify the mysql installation directory owner group

useradd -r -s/sbin/nologin -m mysql

chown -r mysql:mysql/usr/local/mysql /

2, initialize mysql

mysql_ $home/scripts/mysql_install_db --user=mysql --basedir =/usr/locla/mysql --datadir =/usr/local/mysql/data

3.Provide the main configuration file for mysql

cp support-files/my-default.cnf /etc/my.cnf

4.Provide sysv service script for mysql and add it to the service startup list

cp support-files/mysql.server /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld on

chkconfig --list mysqld

5, add the mysql man manual to the man search path,Modify /etc/man.conf to add


6, output the mysql header file to the system header file path

ln -sv/usr/local/mysql/include//usr/include/mysql

7, output the mysql library file to the system search path,And let the system reload the system libraries

echo "/usr/local/mysql/lib">/etc/ld.so.conf.d/mysql.conf


8, modify the environment variables to add mysql, edit/etc/profile to add the path, and reload

export path="$path:/usr/local/mysql/bin"


9. At this point, the installation is complete.Start mysql

service mysqld start

The above is the rhel6.5 compilation and installation mysql5.6.26 tutorial that we share with you, I hope everyone likes it.

  • Previous CountDownTimer implements countdown function in Android
  • Next Android implementation of the function of adding status bar icon