Install Mysql5.7.19 and centos7mysql5.7.19 on centos 7

Source: Internet
Author: User

Install Mysql5.7.19 and centos7mysql5.7.19 on centos 7
1. decompress the file

[Root @ centos3 ~] # Tar-zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz-C/usr/local/

2. Rename

[Root @ centos3 ~] # Cd/usr/local/

[Root @ centos3 local] # Music mysql-5.7.19-linux-glibc2.12-x86_64/mysql

3. Configure Environment Variables

[Root @ centos3 local] # vi +/etc/profile

[Root @ centos3 local] # source/etc/profile

4. Create and authorize a group and user

[Root @ centos3 local] # groupadd mysql

[Root @ centos3 local] # useradd-r-g mysql-s/bin/false mysql

[Root @ centos3 local] # chown-R mysql/
[Root @ centos3 local] # chgrp-R mysql/

 

5. initialize and remember the last 12-bit password

[Root @ centos3 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.

[Root @ centos3 local] # cd/usr/local/mysql/support-files/
[Root @ centos3 support-files] # vi mysql. server

[Root @ centos3 support-files] # cp mysql. server/etc/init. d/mysqld

7. Rename my. cnf

[Root @ centos3 support-files] # mv/etc/my. cnf/etc/my_default.cnf

8. Set startup

[Root @ centos3 support-files] # chmod + x/etc/init. d/mysqld
[Root @ centos3 support-files] # chkconfig -- add mysqld
[Root @ centos3 support-files] # chkconfig mysqld on

// Check whether startup is successful

[Root @ centos3 support-files] # chkconfig -- list mysqld

9. Start the service

[Root @ centos3 support-files] #/etc/init. d/mysqld start
[Root @ centos3 support-files] # service mysql start

10. log on to and change the password. The password is generated by the system in step 1.

[Root @ centos3 support-files] # mysql-uroot-p

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

 

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.