-
下载mysql源安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
-
安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
-
安装mysql
yum -y install mysql-community-server
-
启动mysql服务
systemctl start mysqld
-
查看mysql状态
systemctl status mysqld
-
设置开机启动
systemctl enable mysqld systemctl daemon-reload
-
修改root用户初试密码
grep 'temporary password' /var/log/mysqld.log mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'AAaa&000000';
-
添加远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'AAaa&000000' WITH GRANT OPTION;
CentOS 7 搭建mysql 5.7
young
768
2021-10-17