mysql5.7 installation (yum online mode)

installation
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server
systemctl start mysqld

change Password

 

Find the initial password
grep 'temporary password' /var/log/mysqld.log
2020-04-11T07:53:15.951160Z 1 [Note] A temporary password is generated for root@localhost: g(wfb5Nhf.2L

Login to change password
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@WSX';

Turn on remote

mysql -u root -p
show databases;
use mysql;
show tables;
update user set Host='%' where User='root';
grant all privileges on *.* to root@"192.168.1.9" identified by "1qaz@WSX";
flush privileges;

Configure the default encoding to utf8

vi / etc / my.cnf
#Add [mysqld] 
character_set_server=utf8 
init_connect='SET NAMES utf8'

Restart / set boot

systemctl restart mysqld
systemctl enable mysqld 

 

reference:
https://blog.csdn.net/wohiusdashi/article/details/89358071

Guess you like

Origin www.cnblogs.com/libin2015/p/12685156.html
Recommended