CMake Compiling and installing MySQL

Source: Internet
Author: User

In real-world applications, most companies will typically compile and install MySQL


System environment: CentOS 6.7 Finall

1, install the required dependency package

Yum Install-y ncurses-devel.x86_64

Yum Install-y cmake.x86_64

Yum Install-y libaio.x86_64

Yum Install-y bison.x86_64

Yum Install-y gcc-c++.x86_64

If you cannot install Yum, you can hang it on the CD or locate the appropriate installation package.

2, installation

[[email protected] local] #groupadd MySQL

[[email protected] mysql-5.6.22] #seradd-g MySQL MySQL

[email protected] local] #Tar-XVF mysql-5.6.22.tar.gz

[[email protected] local] #cd/mysql-5.6.22

[[email protected] mysql-5.6.22] #kdir /usr/local/mysql -- Create the installation path

[[email protected] mysql-5.6.22] #kdir /usr/local/mysql/data --- Create a database file path

[[email protected] mysql-5.6.22] #cmake. -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/data -DWITH_INNOBASE_ storage_engine=1-dmysql_unix_addr==/usr/local/mysql/mysql.sock-dmysql_user=mysql-ddefault_charset= Utf8-ddefault_collation=utf8_general_ci

The normal situation is completed successfully, if an error occurs, please find the cause of the problem according to the actual error.

Then Make,make install.

[[email protected] mysql-5.6.22] #ake && make install

MySQL will be installed by default in the specified/usr/local/mysql directory

3, initialize the data

[[email protected] mysql-5.6.22] #d/usr/local/mysql

[email protected] mysql-5.6.22]# scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/home/data/mysql/ DATA--DEFAULTS-FILE=/USR/LOCAL/MYSQL/MY.CNF

After the data has been initialized for completion, follow the instructions for the document operation.

4,mysql Database Run environment configuration  

[[email protected] local] #cd/usr/local/mysql

[[email protected] MySQL] #cp support-files/my-default.cnf/etc/my.cnf

[[email protected] MySQL] #chown mysql:mysql/etc/my.cnf

[[email protected] MySQL] #chmod-R 700/etc/my.cnf

[[email protected] MySQL] #cp support-files/mysql.server/etc/init.d/mysqld

[[email protected] MySQL] #chmod-R 700/etc/init.d/mysqld

[[email protected] MySQL] #chown mysql:mysql /etc/init.d/mysqld

[[email protected] MySQL] #chown mysql:mysql/usr/local/mysql

[[email protected] MySQL] #echo "Export path= $PATH:/usr/local/mysql/bin" >>/etc/profile

[[email protected] MySQL] #source/etc/profile

[[email protected] MySQL] #vi/etc/my.cnf--Modify it into some content

650) this.width=650; "src=" Http:// "title=" Mysql.png "alt=" Wkiom1ayw3gizkj7aablolr2nm4093.png "/>5, start MySQL service

[[email protected] mysql]#/etc/init.d/mysqld start

CMake Compiling and installing MySQL

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: 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.