#查询源码包 Yum List|grep ncurses-devel
#创建gcc: yum-y Install make gcc-c++ cmake bison-devel ncurses-devel
Download MySQL installation package: wget https://dev.mysql.com//Downloads/MySQL-5.6/mysql-5.6.35.tar.gz
to decompress; Tar zxvf mysql-5.6.35.tar.gz
to enter; CD mysql-5.6.35
Recursively creating directories: Mkdir-p/usr/local/mysql/data
Compile and install:
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=/usr/local/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
Dcmake_install_prefix=dir_name |
Setting up the MySQL installation directory |
-dmysql_unix_addr=file_name |
Set the listener socket path, which must be an absolute pathname. Default is/tmp/mysql.sock |
-ddefault_charset=charset_name |
Sets the character set of the server. By default, MySQL uses the latin1 (CP1252 Western European) character set. The Cmake/character_sets.cmake file contains a list of allowed character set names. |
-ddefault_collation=collation_name |
Sets the collation of the server. |
-dwith_innobase_storage_engine=1 -dwith_archive_storage_engine=1 -dwith_blackhole_storage_engine=1 -dwith_perfschema_storage_engine=1 |
Storage Engine Options:
Myisam,merge,memory, and the CSV engine is compiled to the server by default and does not need to be explicitly installed.
Statically compiles a storage engine to the server, using-dwith_engine_storage_engine= 1
The available storage engine values are: ARCHIVE, Blackhole, EXAMPLE, Federated, Innobase (InnoDB), PARTITION (partitioning support), and Perfschema ( Performance Schema) |
-dmysql_datadir=dir_name |
Set the MySQL database file directory |
-dmysql_tcp_port=port_num |
Set the MySQL server listening port, default to 3306 |
-denable_downloads=bool |
Whether you want to download the optional files. For example, if you enable this option (set to 1), CMake will download the test suite that Google uses to run unit tests. |
MySQL installation in Linux under the detailed