Install mysql-5.6.36 on CentOS6.9

Source: Internet
Author: User

This article references from the blog park, thanks to the original author.

1 , preparing the file system for data storage

Create a new logical volume and mount it to a specific directory. The process is no longer given here.

This assumes that the mount directory of its logical volume is /data, and then needs to create the/data/mysqldata directory as MySQL The directory where the data is stored.

[Email protected]/]# mkdir-p/data/mysqldata

2 , the new user runs the process in a secure manner:

[[email protected] ~]# groupadd-r MySQL [[email protected] ~]# useradd-g mysql-r-s/sbin/nologin-m-d/data/mysqldata Mysql

[Email protected] ~]# chown-r mysql:mysql/data/mysqldata

3 , install, and initialize mysql-5.6.23

Download First linux64 bits binary version of the MySQL5.6 to local, mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

[email protected] ~]# tar xf mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz-c/usr/local # The installation package name needs to be modified

[Email protected] ~]# cd/usr/local/

[Email protected] ~]# LN-SV mysql-5.6.36-linux-glibc2.5-x86_64/mysql

[[Email protected] ~]# CD MySQL

[Email protected] ~]# chown-r mysql:mysql.

[Email protected] ~]# scripts/mysql_install_db--user=mysql--datadir=/data/mysqldata/

[Email protected] ~]# chown-r root.

4 , for MySQL To provide a master profile: # The default initialization is / etc under a my.cnf

[Email protected] ~]# cd/usr/local/mysql/support-files [[email protected] ~]# CP my-default.cnf/etc/my.cnf

5. provide sysv for MySQL Service script:

[Email protected] ~]# cd/usr/local/mysql [[email protected] ~]# CP support-files/mysql.server/etc/rc.d/ Init.d/mysqld

[Email protected] ~]# Ldconfig

9, modify the PATH environment variable, so that the system can directly use mysql related commands.

[Email protected] ~]# echo "path= $PATH:/usr/local/mysql/bin" >/etc/profile.d/mysql. SH [Email protected] ~]# source/etc/profile.d/mysql. SH

provide a configuration file for the MySQL service /etc/my.cnf , the contents are as follows:

[Email protected] ~]# VIM/ETC/MY.CNF

[Client]

Port = 3306

Socket =/tmp/mysql.sock

Default-character-set = UTF8

[MySQL]

No-auto-rehash

Default-character-set = UTF8

[Mysqld]

Server-id = 114

Port = 3306

user = MySQL

Basedir =/usr/local/mysql

DataDir =/data/mysqldata

Socket =/tmp/mysql.sock

Default-storage-engine = INNODB

Character-set-server = UTF8

Connect_timeout = 60

Wait_timeout = 18000

Back_log = 500

Event_scheduler = On

to ensure MySQL The service starts normally, please create the relevant directory and give permission according to the above configuration file:

[Email protected] ~]# mkdir -p/data/mysqllog/logs [[email protected] ~]# chown -R Mysql.mysql/dat A/mysqllog/logs

Finally start the service:

[[Email protected] ~]# service mysqld start

Install mysql-5.6.36 on CentOS6.9

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.