-
下载MySQL官方的 Yum 源
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
-
安装Yum源
yum -y install mysql57-community-release-el7-10.noarch.rpm
-
安装MySQL
yum -y install mysql-community-server
-
启动MySQL
systemctl start mysqld.service
-
查看运行状态
systemctl status mysqld.service
-
日志中查找root密码
grep "password" /var/log/mysqld.log
-
命令登录数据库
mysql -uroot -p
-
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Kunkkawu.com!';
这里注意密码的复杂度有要求
-
授权远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
版权归属:
KunkkaWu
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区