Centos 7.x YUM安装Mysql

下载Mysql源安装包
yum安装mysql
yum localinstall mysql57-community-release-el7-8.noarch.rpm
检查mysql源是否安装成功
 yum repolist enabled | grep "mysql.*-community.*"
yum安装Mysql
 yum install mysql-community-server
启动Mysql服务
systemctl start mysqld
并添加开机启动
systemctl enable mysqld systemctl daemon-reload
查看Mysql状态
systemctl status mysqld
查看默认的mysql密码
vi /var/log/mysqld.log
修改mysql的密码
set password for 'root'@'localhost'=password('xxxxxxxxx');

参与评论