Centos 6.6 Compile and install MySQL-5.6.23

Source: Internet
Author: User
Tags chmod

1. Download the official source code
  • Mysql:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz

  • Cmake:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz

2. Compile and install MySQL before you start

sudo yum install gcc gcc-c++ ncurses-devel perl-y

3. Compile and install CMake

Tar xzvf cmake-3.0.2.tar.gz
CD cmake-3.0.2
./bootstrap
Make
Make install

4. Adding MySQL Users and Groups

sudo useradd MYSLQ

5. Create the required directory for MySQL

Mkdir-p/usr/local/mysql
Mkdir-p/data/mysqldb
Chmod-r Mysql:mysql/usr/local/mysql
Chmod-r Mysql:mysql/data/mysqldb

6. Compile and install MySQL
compilation Options Option Description
-dcmake_install_prefix=dir_name Setting up the MySQL installation directory
-dmysql_unix_addr=file_name Set the listener socket path
-ddefault_charset=charset_name Set the character set of the server
-ddefault_collation=collation_name Set the collation of the server
-dmysql_datadir=dir_name Set the MySQL database file directory
-dmysql_tcp_port=port_num To set the port for a listening socket

Tar-zxv-f mysql-5.6.22.tar.gz
CD mysql-5.6.22
Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_addr=mysql.mysql-ddefault_charset=gbk-ddefault_ Collation=gbk_chinese_ci-dwith_innobase_storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_ Storage_engine=1-dmysql_datadir=/data/mysqldb-dmysql_tcp_port=3306-denable_downloads=1
Make && make install
Cd/usr/local/mysql

7. Copy the configuration file and startup script for the MySQL service

scripts/mysql_install_db--user=mysql--datadir=/data/mysqldb CP support-files/mysql.server/etc/init.d/mysqld
CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF CP Support-files/mysql.server/etc/init.d/mysqld
Vim/etc/profile
path=/usr/local/mysql/bin:/usr/local/mysql/lib:/$PATH
Export PATH
Source/etc/profile
Start Mysql:service mysqld Start
Join boot: chkconfig--level mysqld on


This article is from the "Ops Boy" blog, please make sure to keep this source http://kaliroot.blog.51cto.com/8763915/1875576

Centos 6.6 Compile and install MySQL-5.6.23

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.