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;

浙公网安备 33010602011771号