1.Adding the MySQL Yum Repositorymysql
First, add the MySQL Yum repository to your system's repository list. Follow these steps:sql
Install the downloaded release package with the following command, replacing platform-and-version-specific-package-name with the name of the downloaded package:
shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpm
For example, for version n of the package for EL6-based systems, the command is:
shell> sudo rpm -Uvh mysql80-community-release-el6-n.noarch.rpm
shell
Note
Once the release package is installed on your system, any system-wide update by the yum update command (or dnf upgrade for dnf-enabled systems) will automatically upgrade MySQL packages on your system and also replace any native third-party packages, if Yum finds replacements for them in the MySQL Yum repository. See Upgrading MySQL with the MySQL Yum Repository and Replacing a Native Third-Party Distribution of MySQL for details.ide
shell> yum repolist all | grep mysql shell> yum repolist enabled | grep mysql
shell> sudo yum install mysql-community-server
systemctl start mysqld.service
A superuser account 'root'@'localhost' is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:code
shell> sudo grep 'temporary password' /var/log/mysqld.log
change validate_passwordorm
set global validate_password.policy=0;
Allow external accessserver
use mysql update user set host='%' where user='root';
change identified type alter user 'root'@'localhost' identified with mysql_native_password by '123456';
ci