1- Yum repository configuration
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
2- mounting MySql
2.1 Disable all repositories mysql repo file
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
2.2 operating system according to one of the following command to install MySQL
yum --enablerepo=mysql80-community install mysql-community-server
3- service starts
3.1 SysVinit command
service mysqld start
3.2 Systemd command
systemctl start mysqld.service
4- find the default root account password
grep "A temporary password" /var/log/mysqld.log
5-MySql Post installation setup, execute the following command, and then all will reply y
mysql_secure_installation
6- restart and open MySql service
### Using SysVinit
service mysqld restart
chkconfig mysqld on
### Using Systemd
systemctl restart mysqld.service
systemctl enable mysqld.service
7- landing MySql
mysql -h localhost -u root -p
7.1 Creating a User
CREATE USER 'lyra'@'%' IDENTIFIED BY 'xxxx';
7.2 User Authorization
GRANT ALL PRIVILEGES ON *.* TO 'lyra'@'%' WITH GRANT OPTION;
7.3 Authorization NAVICAT client link
ALTER USER 'lyra'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxx';
FLUSH PRIVILEGES;
7.4 command to take effect
FLUSH PRIVILEGES;
7.5 Change Password
PS: do not need to flush privileges to refresh the permissions
ALTER user 'root'@'localhost' IDENTIFIED BY 'XXXX'
8- reference address
Reference Address: https://tecadmin.net/install-mysql-8-on-centos/