Linux installation mysql8.0 and open remote access

Source: Internet
Author: User

First step: Get mysql8.0 's Yum source

    

Go to MySQL website for RPM package

https://dev.mysql.com/downloads/repo/yum/

After you click Download,

        

Right-click Copy link Address https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

This is.

Step two download and install the MySQL source

The wget directive is not installed and needs to be installed first.

Yum-y Install wget     

After the installation is successful, download the MySQL source

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

After the download is complete, install the MySQL source

Yum-y Localinstall mysql80-community-release-el7-11.noarch.rpm

Step three: Install MySQL online

Yum-y Install Mysql-community-server

Download more things to wait a bit;

Fourth step: Start the MySQL service

Systemctl Start mysqld

Fifth step: Set boot start

Systemctl Enable Mysqld

Systemctl Daemon-reload

Sixth step: Modify the root local login password

After the MySQL installation is complete, a temporary default password is generated for root in the/var/log/mysqld.log file.

[Email protected] ~]# Vi/var/log/mysqld.log

Found a temporary password k>ey>8bcws=s

You need to change your password at this time.

      

After entering the temporary password,

ALTER USER ' root ' @ ' localhost ' identified by ' [email protected] '; Note: Names must have uppercase letters, numbers and special symbols

Seventh step: Set Allow remote login and open firewall

MySQL does not allow Telnet by default, so you need to turn on remote access permission

You can view the user table first

Select User,authentication_string,host from user;

     

localhost is the default

Update user Set host = '% ' where user = ' root ';

      

At this point, the host of Root is all that is possible.

Then turn on the firewall

      

[Email protected] ~]# firewall-cmd--zone=public--add-port=3306/tcp--permanent

Success

[Email protected] ~]# Firewall-cmd--reload

Success

[Email protected] ~]#

Eighth Step: Configure the default encoding to UTF8

     

Modify the/ETC/MY.CNF configuration file and add the encoding configuration under [Mysqld] as follows:

[Mysqld]

Character_set_server=utf8

init_connect= ' SET NAMES UTF8 '

      

      

Edit the restart MySQL service after saving;

[Email protected] ~]# systemctl restart mysqld

[Email protected] ~]#

View the following code:

Mysql> Show variables like '%character% ';

      

You can see that the UTF8 character has been changed.

     

     

      

      

      

      

             

Linux installation mysql8.0 and open remote access

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.