Centos7 installing MySQL in a binary way

Source: Internet
Author: User
Tags mysql commands mysql in

First download the binary installation package:
: https://downloads.mysql.com/archives/community/
Alternate Address: Https://pan.baidu.com/s/1iks660z9Kqu4gVOiAsiERg
1. Install dependent packages

2, upload the binary package decompression, and establish a soft connection without version number

TAR-ZXF mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz
Ln-s/opt/mysql-5.6.27-linux-glibc2.5-x86_64/opt/mysql

3. Create the relevant file directory
Mkdir-p/opt/mysql/{data,sock,binlog,slowlog,pid,errlog}

4, Configuration/etc/my.cnf
Vim/etc/my.cnf

Configuration file:
5. Create a MySQL user and authorize
Groupadd MySQL
Useradd–s/sbin/nologin–g mysql–m MySQL
Chown-r mysql.mysql/opt/mysql/
6. Initialize the database
/opt/mysql/scripts/mysql_install_db--defaults-file=/etc/my.cnf--basedir=/opt/mysql--datadir=/opt/mysql/data-- User=mysql

7. Add the startup script to Init.d

Cp-rp/opt/mysql/support-files/mysql.server/etc/init.d/mysqld
Note the MySQL path specified in the startup script;

8. Then start the database

You can see that port 3306 is up.
9. Configure the global use path for MySQL commands

Then source under to make immediate effect

10. Join open Self-start

Note that CENTOS7 needs to add execution permissions to Rc.local and execute the following command
chmod +x/etc/rc.d/rc.local

Centos7 installing MySQL in a binary way

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.