The first is to install the CMake environment. Because Bo main test machine is Ubuntu, so directly with Apt-get install CMake command to install, Yum believe should also be the same. Alternatively, you can compile the installation in the following steps.
Copy Code code as follows:
wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
Tarx ZVFC cmake-2.8.12.2.tar.gz
CD cmake-2.8.12.2
./configure
Make && make install
After the installation is complete, perform cmake-version and make sure that it is installed correctly.
Then download the MySQL latest source package, compile the installation.
Copy Code code as follows:
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.36.tar.gz
Tar xzvf mysql-5.5.36.tar.gz
CD mysql-5.5.36
Cmake-dcmake_install_prefix=/usr/local/mysql-dextra_charsets=all-ddefault_charset=utf8-ddefault_collation=utf8 _general_ci-dwith_readline=1-dwith_ssl=system-dwith_zlib=system-dwith_embedded_server=1-denabled_local_infile= 1-dmysql_datadir=/data/mysql
Make && make install
Here the blogger encounters an error about SSL, and the prompt is shown below.
Linking C shared module adt_null.so
[65%] Built Target Audit_null
Scanning dependencies of Target vio
[65%] Building C Object VIO/CMAKEFILES/VIO.DIR/VIO.C.O
[65%] Building C Object VIO/CMAKEFILES/VIO.DIR/VIOSOCKET.C.O
[65%] Building C Object VIO/CMAKEFILES/VIO.DIR/VIOSSL.C.O
/root/mysql-5.5.36/vio/viossl.c:in function ' Ssl_do ':
/root/mysql-5.5.36/vio/viossl.c:175:error: ' Ssl_op_no_compression ' undeclared (in the This function)
/root/mysql-5.5.36/vio/viossl.c:175:error: (Each undeclared identifier are reported only once
/root/mysql-5.5.36/vio/viossl.c:175:error:for each function it appears in.)
MAKE[2]: * * * [VIO/CMAKEFILES/VIO.DIR/VIOSSL.C.O] Error 1
MAKE[1]: * * * [Vio/cmakefiles/vio.dir/all] Error 2
Make: * * * [ALL] Error 2
The reason for this problem is that mysql5.5 cannot be compiled in openssl-1.0.0 and later. If you do not need SSL to remove the With_ssl configuration items, you can also upgrade the OpenSSL version, and a more convenient way to make a patch before cmake.
Copy Code code as follows:
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.36.tar.gz
Tar xzvf mysql-5.5.36.tar.gz
CD mysql-5.5.36
Wget-c "http://bugs.mysql.com/file.php?id=19941&bug_id=68999"-O Mysql-openssl.patch
Patch-p1 < span > Mysql-openssl.patch
Finally, copy the configuration file, modify it.
Copy Code code as follows:
CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
Sed '/skip-external-locking/i\datadir =/data/mysql '-i/etc/my.cnf
Sed-i ' s: #innodb: Innodb:g '/etc/my.cnf
Sed-i ' S:/usr/local/mysql/data:/data/mysql:g '/etc/my.cnf
Start MySQL, Success!