美文网首页
CentOS 7.4 install MySQL 5.7

CentOS 7.4 install MySQL 5.7

作者: ytxing | 来源:发表于2018-10-30 20:00 被阅读10次

1. 下载rpm包

wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

检查md5

md5sum mysql57-community-release-el7-9.noarch.rpm

输出

1a29601dc380ef2c7bc25e2a0e25d31e  mysql57-community-release-el7-9.noarch.rpm

2. 安装

sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
sudo yum install mysql-server

3. 启动

sudo systemctl start mysqld

检查启动是否成功

sudo systemctl status mysqld

4. 连接

找到临时密码

sudo grep 'temporary password' /var/log/mysqld.log

输出如下

2016-12-01T00:22:31.416107Z 1 [Note] A temporary password is generated for root@localhost: mqRfBU_3Xk>r

使用该密码连接。

5. 添加到自启动

chkconfig --level 2345 mysqld on

重启机器,检查MySQL是否还在。

相关文章

网友评论

      本文标题:CentOS 7.4 install MySQL 5.7

      本文链接:https://www.haomeiwen.com/subject/trtntqtx.html