CentOS installation configuration MySQL database

Source: Internet
Author: User
Tags mysql version

CentOS version 7.2, MySQL version 5.7

1. Download MySQL installation source

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

2. Install MySQL source

RPM-IVH mysql57-community-release-el7-11.noarch.rpm

3. Install MySQL

Yum Install mysql-community-server-y

4. Start MySQL

Systemctl start Mysqld.service or service mysqld restart

5. Change the password

MySQL5.7 strengthens the root user's security, so a random password is initialized after the first installation, the following is how to view the initial random password

grep ' temporary password '/var/log/mysqld.log grep command using tutorial

The results are as follows:

  

After logging in with the initial random password, MySQL will be forced to change the password, otherwise it would not work, (the password must contain lowercase, uppercase and special characters, of course, there are other methods not subject to this limitation, again do not describe more), modify the method as follows:

SET PASSWORD = PASSWORD (' Your new PASSWORD '); ALTER USER ' root ' @ ' localhost ' PASSWORD EXPIRE never;flush privileges;

Then you can sign in with your new password after exiting.

6. Remote Connection Authorization

MySQL is based on the MySQL database in the user table inside the host field to do IP authentication, modified to ' @ ' means no limit connection, you can also specify an IP address.

Use MySQL;

Update set User host= ' @ ' where user= ' root ';

7. Open 3306 Port

  The firewall needs to be restarted after opening the port, Firewalld use reference

Firewall-cmd --zone=public --add-port=3306/tcp--permanent

Firewall-cmd--reload

Above reference http://www.cnblogs.com/longrui/p/6071581.html

CentOS installation configuration MySQL database

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.