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