centos7 yum 安装mysql5.7

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql57-community-release-el7-10.noarch.rpm' yum -y install mysql-community-server systemctl start mysqld.service systemctl enable mysqld.service

 


grep "password" /var/log/mysqld.log 查看密码

 

 

进入mysql :   

mysql -uroot -p

 

修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

 

开启远程访问:

grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;

flush privileges;

exit;

 

posted @ 2022-07-20 15:28  运维之王  阅读(22)  评论(0)    收藏  举报