This article describes how to compile and install MySQL in CentOS and how to set the yum source. you can use the RedHat Linux system as the environment for reference, if you want to compile and install software, you may encounter various problems, especially when compiling a variety of software such as lamp to work collaboratively, 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:
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
The above is the tutorial _ MySQL for compiling and installing MySQL and setting the relevant yum source in CentOS. For more information, see PHP Chinese network (www.php1.cn )!