Realize:
1. Installing the CMake Dependency package
# yum -y install ntp vim-enhanced gcc gcc-c++ flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel Libpng-devel libtiff-devel freetype-devel libxpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel libxml2-devel curl-devel libicu libicu-devel libmcrypt libmcrypt-devel libmhash Libmhash-devel
2. Download the CMake source package
# wget # tar zxvf cmake-2.8.7.tar.gz# cd cmake-2.8.7#./configure# make && make install
3. Compiling the installation configuration MySQL
3.1 Creating users and required directories
# mkdir-pv/opt/mysql/data # mkdir/var/log/mysql# Groupadd mysql//create MySQL user and MySQL group # useradd-g Mysql-s/usr/sbin/nol Ogin MySQL
3.2 CMake Compile and install
# tar zxvf mysql-5.5.22.tar.gz# cd mysql-5.5.22# cmake -dcmake_install_ Prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/data -ddefault_charset=utf8 -ddefault_ collation=utf8_unicode_ci -dwith_readline=1 -dwith_ssl=system -dwith_embedded_server=1 - denabled_local_infile=1 -ddefault_collation=utf8_general_ci -dwith_myisam_storage_engine=1 - Dwith_innobase_storage_engine=1 -dwith_debug=0# make && make install
3.3 Copying configuration files and setting permissions
# CP support-files/my-medium.cnf/etc/my.cnf# chmod +x/usr/local/mysql# chown-r mysql:mysql/usr/local/mysql# chown-r m Ysql:mysql/usr/local/mysql/data
3.4 Configuring startup scripts and booting from boot
# CP support-files/mysql.server/etc/init.d/mysqld# chmod +x/etc/init.d/mysqld# chkconfig--add mysqld# chkconfig mysqld On
3.5 Modify the configuration file and add it in [mysqld]
# Vim/etc/my.cnfdatadir =/opt/mysql/datalog-error =/var/log/mysql/data/error.logpid-file =/var/log/mysql/data/ Mysql.piduser = Mysqltmpdir =/tmp
3.6 Initializing the database
#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/opt/mysql/data
3.7 Starting MySQL Manually
# service Mysqld Start
4. Test whether MySQL is started, see if there is a MySQL process, see if there is a MySQL port
# Ps-ef | grep mysql# NETSTAT-TNLP | grep 3306
5. Add MySQL soft link can use the user directly
# ln -sv /usr/local/mysql/bin/mysql /usr/bin/mysql# ln -sv /usr/local/ mysql/bin/mysqladmin /usr/bin/mysqladmin# ln -sv /usr/local/mysql/bin/mysqldump /usr/ bin/mysqldump# mysqladmin version //get MySQL version information Test mysql,mysqladmin,mysqldump command to work
/usr/local/src/mysql-5.5.32/vio/viossl.c: in function ' Ssl_do ':/usr/local/src/mysql-5.5.32/vio /viossl.c:175: error: ' ssl_op_no_compression ' undeclared (first use in this function)/usr/local/src/mysql-5.5.32/vio/viossl.c:175: error: (Each undeclared Identifier is reported only once/usr/local/src/mysql-5.5.32/vio/viossl.c:175: error: for each function it appears in.) make[2]: *** [vio/cmakefiles/vio.dir/viossl.c.o] error 1make[1]: *** [vio/ Cmakefiles/vio.dir/all] error 2make: *** [all] error 2
Online check, should be the version of OpenSSL is too low caused by the CENTOS6 on the compilation of this problem. The official has given a fix to the patch, the content is as follows
-mysql-5.5.32/vio/viossl.c~2013-03-25 14:14:58.000000000 +0100
+ + + mysql-5.5.32/vio/viossl.c2013-04-18 16:58:38.552557538 +0200
@@ -172,8 +172,10 @@
Ssl_session_set_timeout (Ssl_get_session (SSL), timeout);
SSL_SET_FD (SSL, VIO->SD);
#ifndef Have_yassl
#ifdef ssl_op_no_compression
Ssl_set_options (SSL, ssl_op_no_compression);
#endif
#endif
if ((r= connect_accept_func (SSL)) < 1)
{
This means that in the source code of the vio/viossl.c file in the corresponding location, add the Bold 2 lines, and then make the compilation again.
MySQL 5.5 compilation installation