MENU

CentOS7安装MySQL 5.7

下载MySQL安装包

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

安装MySQL源

yum -y localinstall mysql57-community-release-el7-11.noarch.rpm 

安装MySQL

yum -y install mysql-community-server

启动MySQL服务

systemctl start mysqld

设置开机启动

systemctl enable mysqld
systemctl daemon-reload

查看默认密码

vi /var/log/mysqld.log

位于A temporary password is generated for root@localhost:

修改root密码

mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '刚才log文件中的密码';

开启远程登录

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

重启MySQL

systemctl restart mysqld

后记

如果使用官方源安装慢的同学,可以移步CentOS7 使用国内源安装 MySQL5.7


文章标题:CentOS7安装MySQL 5.7
如果文中内容侵犯了您的权益,请及时与博主取得联系进行删除!
本站文章未经许可禁止转载,本文地址:https://blog.wanvale.com/archives/361/

Last Modified: August 4, 2021
Archives QR Code Tip
QR Code for this page
Tipping QR Code