Compile and install MySQL in CentOS and set the yum source tutorial,

Source: Internet
Author: User

Compile and install MySQL in CentOS and set the yum source tutorial,

Compilation and installation of software usually encounter various problems, especially when compiling a variety of software such as lamp, the software also affects each other, in particular, the software installed earlier may affect the compilation and installation of the later program. This problem is often caused by the absence of export files and header files for the previously installed software, as a result, when subsequent software installation is required to specify the path of the preceding installer, errors such as file not found are often prompted. The following uses mysql as an example.


1. Install the development environment

yum groupinstall "Development tools"

2. Solve the software package dependency package

Install the package required for compiling code

yum -y install make gcc-c++ cmake bison-devel ncurses-devel

Download MySQL 5.6.14

wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14.tar.gztar xvf mysql-5.6.14.tar.gzcd mysql-5.6.14

3. Configure compilation and Installation

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=/var/lib/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_cimake && make install

4. Warehouse export search
Create the corresponding conf file in the/etc/ld. conf. d/mysql. conf directory.

ldconfig -v | grep mysql

5. Export the header file

ln -sv /usr/local/mysql/include /usr/include/mysql

6. Export a Help File

vim /etc/man.config MANPATH /usr/local/mysql/man

7. Export the binary path

vim /etc/profile PATH=/usr/local/mysql/bin:$PATHsource /etc/profile

PS: How to Use the MySQL yum source to install and update MySQL-related software packages
The MySQL yum Library provides a simple and convenient way to install and update MySQL-related software packages to the latest version.
MySQL yum library documentation Description: http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
MySQL yum Database supports the following platforms:
Red Hat Enterprise Linux 7/Oracle Linux 7
Red Hat Enterprise Linux 6/Oracle Linux 6
Red Hat Enterprise Linux 5/Oracle Linux 5
Fedora 18, 19, and 20
The MySQL yum library includes the latest software packages:

  • MySQL 5.6 (GA)
  • MySQL 5.7 (Development Release)
  • MySQL 5.5 (GA-Red Hat Enterprise Linux and Oracle Linux Only)
  • MySQL Workbench
  • MySQL Fabric
  • MySQL Utilities
  • MySQL Connector/ODBC
  • MySQL Connector/Python

RHEL7/CentOS7/Oracle linux7:

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

RHEL5/CentOS5/Oracle linux5:

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm

Fedora

# Fedora20

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc20-5.noarch.rpm

 
# Fedora19

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc19-5.noarch.rpm

 
# Fedora18

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc18-5.noarch.rpm

Articles you may be interested in:
  • View nginx apache mysql php compilation parameters in Linux
  • How to compile and use apache mysql php source code
  • Share the compilation and installation records of MySQL 5.5.8 source code in Linux

Related Article

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.