Simple Steps for compiling and installing Mysql5.5 in Linux _ MySQL

Source: Internet
Author: User
In Linux, compilation and installation will be different from version 5.1 because cmake is used for config from mysql5.5. But in general, the difference is not big. first, install the cmake environment. Because the master testing machine is ubuntu, you can directly use the apt-get install cmake command to install it. The same should be true for yum. You can also compile and install the SDK by following the steps below.

The code is 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, run cmake-version to confirm that the installation is correct.

Then download the latest mysql source code package, compile and install it.

The code is 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-character = bytes-DWITH_READLINE = 1-DWITH_SSL = system-DWITH_ZLIB = system-character = 1-character = 1-DMYSQL_DATADIR =/data/mysql
Make & make install

Here, the blogger encounters an ssl error and the prompt is as follows.

Linking C shared module adt_null.so
[2, 65%] Built target audit_null
Scanning dependencies of target vio
[2, 65%] Building C object vio/CMakeFiles/vio. dir/vio. c. o
[65%] Building C object vio/CMakeFiles/vio. dir/visocket. c. o
[65%] Building C object vio/CMakeFiles/vio. dir/vissl. c. o
/Root/mysql-5.5.36/vio/vissl. c: In function 'SSL _ do ':
/Root/mysql-5.5.36/vio/vissl. c: 175: error: 'SSL _ OP_NO_COMPRESSION 'undeclared (first use in this function)
/Root/mysql-5.5.36/vio/vissl. c: 175: error: (Each undeclared identifier is reported only once
/Root/mysql-5.5.36/vio/vissl. c: 175: error: for each function it appears in .)
Make [2]: *** [vio/CMakeFiles/vio. dir/vissl. c. o] Error 1
Make [1]: *** [vio/CMakeFiles/vio. dir/all] Error 2
Make: *** [all] Error 2

The final cause of this problem was that mysql5.5 could not be compiled in openssl-1.0.0 or earlier versions. If you do not need ssl, you can remove the WITH_SSL configuration item, or upgrade the openssl version. In addition, you can install a patch before cmake.

The code is 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 and modify the configuration file.

The code is 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: g'/etc/my. cnf
Sed-I's:/usr/local/mysql/data:/data/mysql: g'/etc/my. cnf

Mysql started!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.