Home>

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:

make:

./configure

./configure --help

cmake:

cmake.

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:

-dwith_innobase_storage_engine=1

-dwith_archive_storage_engine=1

-dwith_blackhole_storage_engine=1

-dwith_federated_storage_engine=1

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

-dwithout_<engine>_storage_engine=1

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

-dwith_readline=1

-dwith_ssl=system

-dwith_zlib=system

-dwith_libwrap=0

Other common options:

-dmysql_tcp_port=3306

-dmysql_unix_addr =/tmp/mysql.sock

-denabled_local_infile=1

-dextra_charsets=all

-ddefault_charset=utf8

-ddefault_collation=utf8_general_ci

-dwith_debug=0

-denable_profiling=1

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

manpan/usr/local/mysql/man

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

ldconfig

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

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

source/etc/profile

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