Install MySQL under CentOS using CMake compilation

Source: Internet
Author: User

One, download the installation of the necessary dependency package

1, because the high version of MySQL is installed with cmake, so download cmake

wget http://www.cmake.org/files/v3.0/cmake-3.0.1.tar.gz

Tar zxvf cmake-3.0.1.tar.gz

CD cmake-3.0.1

./configure

Make && make install

2. Download other Packages

wget http://ftp.gnu.org/gnu/bison/bison-3.0.2.tar.gz

Installation Ibid.

wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz

Installation Ibid.

Ii. Creating catalogs and users

1. Set up MySQL installation directory and data storage directory

  Mkdir/usr/local/mysql

Mkdir/usr/local/mysql/data

2. Set up users and user groups

  Groupadd MySQL

useradd-g MySQL mysql-s/sbin/nologin

3. Give directory Permissions

  Chown Mysql:mysql-r/usr/local/mysql/

Third, compile and install

1. Compile MySQL with CMake

    Tar zxvf mysql-5.6.20.tar.gz

CD mysql-5.6.20

Cmake-dcmake_install_prefix=/usr/local/mysql

Make && make install

 2. Initialize the database

scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql

3. Edit the/USR/LOCAL/MYSQL/MY.CNF configuration file

[Mysqld]

Basedir =/usr/local/mysql

DataDir =/usr/local/mysql/data

Log-error =/usr/local/mysql/mysql_error.log

Pid-file =/usr/local/mysql/mysql.pid

user = MySQL

Tmpdir =/tmp

If this configuration file is not present, then the CP support-files/my-medium.cnf/usr/local/mysql/my.cnf one.

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.