Linux CentOS7 Installation Mysql5.7.19

Source: Internet
Author: User

1. Extracting files

[Email protected] ~]# TAR-ZXVF mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz-c/usr/local/

2. renaming

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

[Email protected] local]# MV Mysql-5.7.19-linux-glibc2.12-x86_64/mysql

3. Configure Environment variables

[Email protected] local]# VI +/etc/profile

[Email protected] local]# Source/etc/profile

4. Create groups and users and authorize

[[email protected] local]# Groupadd MySQL

[[email protected] local]# useradd-r-g mysql-s/bin/false MySQL

[Email protected] local]# chown-r MySQL mysql/
[Email protected] local]# chgrp-r MySQL mysql/

5. Initialize and remember the last 12-bit password

[Email protected] local]#/usr/local/mysql/bin/mysqld--initialize--user=mysql--basedir=/usr/local/mysql/-- datadir=/usr/local/mysql/data/--lc_messages_dir=/usr/local/mysql/share--LC_MESSAGES=ZH_CN

6. Modify the Mysql.server. File and copy it to the/etc/init.d/directory

[Email protected] local]# cd/usr/local/mysql/support-files/
[Email protected]centos3 support-files]# VI mysql.server

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

7. Renaming my.cnf

[Email protected] support-files]# MV/ETC/MY.CNF/ETC/MY_DEFAULT.CNF

8. Set Boot up

[Email protected] support-files]# chmod +x/etc/init.d/mysqld
[Email protected] support-files]# chkconfig--add mysqld
[Email protected] support-files]# chkconfig mysqld on

See if the boot is successful

[Email protected] support-files]# chkconfig--list mysqld

9. Start the service

[[email protected] support-files]#/etc/init.d/mysqld start
[[Email protected] support-files]# service MySQL start

10. Login to change the password, the password is the 5th step system generated

[Email protected] support-files]# mysql-uroot-p

Mysql> set Password=password ("1234");

Linux CentOS7 Installation Mysql5.7.19

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.