installing MySQL under CentOS

Source: Internet
Author: User

    1. Download the latest MYSQL5.6.SRC.RPM source code package

    2. Extracting source code Packages

      Rpm-i mysql-5.6.20-1.rhel5.src.rpm

      Cd/usr/src/redhat/specs

RPMBUILD-BP Mysql.spec

The source code is generated below the/usr/src/redhat/build.

3. Installing CMake

Cd/usr/local/src

TAR-ZXVF cmake2.8.5.tar.gz

./configure

Gmake && gmake Install

Yum Install-y OpenSSL Openssl-devel


4. Install MySQL

Groupadd MySQL

useradd-g MySQL MySQL

Mkdir-p/data/mysql

Chown-r Mysql:mysql/data/mysql

TAR-ZXVF mysql5.6.20.tar.gz

CD mysql5.6.20


CMake. \

-dcmake_install_prefix=/usr/local/mysql \

-dmysql_datadir=/data/mysql \

-DSYSCONFDIR=/USR/LOCAL/MYSQL/ETC \

-dmysql_tcp_port=3306 \

-denabled_local_infile=1 \

-dextra_charsets=all \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-dmysql_user=mysql \

-dwith_debug=0 \

-dwith_innobase_storage_engine=1 \

-dwith_ssl=system \

-dwith_embedded_server=1 \

-dwith_readline=1 \

-dwith_ssl=bundled \

-dwith_partition_storage_engine=1


Make && make install


5. Add a service

CP Support-files/mysql.server/etc/init.d/mysqld #复制脚本

chmod +x/etc/init.d/mysqld #增加可执行权限

Chkconfig--add mysqld #增加至sysV服务

Chkconfig mysqld on #开机自启动


6. Modify Mysqld

Vi/etc/init.d/mysqld

Basedir=/usr/local/mysql

Datadir=/data/mysql


7. Modify the configuration file my.cnf

Datadir=/data/mysql


8. Change the password


bin/mysqladmin-u root password ' xxx '













This article is from the "Gu Juncheng Learning Blog" blog, please be sure to keep this source http://gujuncheng.blog.51cto.com/3740198/1559109

installing MySQL under CentOS

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.