To install MySQL under version 6.4 of CentOS, you must use the new compiler CMake.
1) Install CMake
Direct Yum Installation
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "alt=" image "src=" http://s3.51cto.com/ Wyfs02/m01/5b/4b/wkiol1ufp-djvkjdaacpkmnapho514.jpg "border=" 0 "height=" 103 "/>
2) Compile the installation parameters
The options are changed by using CMake to compile the installation mysql-5.5.33:
./configure CMake. Compile
./configure–help CMake. -lh or Ccmake. Get help
Specifies the options that are commonly used when installing the installation path of a file:
-dcmake_install_prefix=/usr/local/mysql
-dmysql_datadir=/data/mysql
-dsysconfdir=/etc
the storage engines that are compiled by default include: CSV, MyISAM, MYISAMMRG, and heap. To install additional storage engines, you can use a compilation option similar to the following:
-dwith_innobase_storage_engine=1
-dwith_archive_storage_engine=1
-dwith_blackhole_storage_engine=1
-dwith_federated_storage_engine=1
To explicitly specify that a storage engine is not compiled, you can use an option similar to the following:
-dwithout_<engine>_storage_engine=1
Like what:
-dwithout_example_storage_engine=1
-dwithout_federated_storage_engine=1
-dwithout_partition_storage_engine=1
If you want to compile into other functions, such as SSL, you can use a library similar to the following, or do not use a library when compiling:
-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
If you want to clean up the files generated by the previous compilation, you need to use the following command:
Make clean
RM CMakeCache.txt
3) Compile and install
#groupadd-R MySQL create MySQL group #mkdir-pv/mydata/data create a database storage location, preferably using LVM to create logic to ensure/data in logical volumes, prevent physical disk failure resulting in data loss, but in this I did not directly create , which is undesirable in the production environment. #useradd-G mysql-r-d/mydata/data mysql create MySQL user #tar XF mysql-5.5.55.tar.gz unzip mysql#id mysql verify MySQL user is ID is at 500 The following, because only 500 of the system users below, can call 3306 this MySQL default port.
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/5b/4b/wkiol1ufp-hqdnayaae4o19f9oe375.jpg "border=" 0 "height=" 155 "/>
CMake. -dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/mydata/data-dsysconfdir=/etc-dwith_a Rchive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_readline=1-dwith_innobase_storage_eng Ine=1-dwith_ssl=system-dwith_zlib=system-dwith_libwrap=0-dmysql_unix_addr=/tmp/mysql.sock-ddefault_cha Rset=utf8-ddefault_collation=utf8_general_ci
#make #make Install
4) configuration
(1) Modify/usr/local/mysql under All files belong to the group MySQL, and copy support-files/my-large.cnf to/etc/my.cnf (Note: config file), modify/etc/ MY.CNF, in which the default data location Datadir=/mydata/data is added.
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "alt=" image "src=" http://s3.51cto.com/ Wyfs02/m00/5b/4b/wkiol1ufp-lbzclhaasycyesqcg508.jpg "border=" 0 "height=" 556 "/>
(2) Modify the genus Datadi ' r directory;
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m01/5b/4b/wkiol1ufp-kqbji7aaawes-9xs4083.jpg "border=" 0 "height="/>
(3) Copy the startup script and initialize
Copy the script and increase the boot start
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/5b/4b/wkiol1ufp-prb_62aapxny82jhc576.jpg "border=" 0 "height=" 442 "/>
initialize, [[email protected] mysql]# scripts/mysql_install_db--user=mysql--datadir=/mydata/data, if initialization fails, you must delete/mydata/data /* All files, rm–rf/mydata/data/*
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "alt=" image "src=" http://s3.51cto.com/ Wyfs02/m00/5b/4b/wkiol1ufp-oqkbx9aapbo92gpiw268.jpg "border=" 0 "height=" 522 "/>
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m01/5b/4b/wkiol1ufp-thlie8aaa7ph6f5mc558.jpg "border=" 0 "height="/>
(4) Setting the variable environment:
# echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile (permanent)
# Export path= $PATH:/usr/local/mysql/bin (currently in force)
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/5b/4b/wkiol1ufp-tymk2qaab0orrlugq798.jpg "border=" 0 "height="/>
(5) Start MySQL
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "alt=" image "src=" http:// S3.51cto.com/wyfs02/m00/5b/4b/wkiol1ufp-steq3kaafcfwvrpxu127.jpg "border=" 0 "height=" 218 "/>
This article from "WJ" blog, declined reprint!
centos6.4 under compile and install MySQL-5.5.33