目 录CONTENT

文章目录

CentOS7 64位下MySQL5.7安装与配置(YUM)

码农街
2020-01-03 / 0 评论 / 0 点赞 / 19 阅读 / 2307 字 / 正在检测是否收录...

下载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 repolist enabled | grep "mysql.*-community.*" 

安装

yum install mysql-community-server 

如果出现

No match for argument: mysql-community-server Error: Unable to find a match: mysql-community-server

则运行

 yum module disable mysql  yum -y install mysql-community-server 

启动mysql

systemctl start mysqld 

设置开机自启

systemctl enable mysqld 

修改root本地登录密码

# 查看初始密码 
grep 'temporary password' /var/log/mysqld.log 
# 登陆并输入初始密码
mysql -uroot -p 
#修改密码 
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourPassWd!!';  
# 或者
set password for 'root'@'localhost'=password('YourPassWd!!');  

设置远程登陆用户

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'YourPassWd!!' WITH GRANT OPTION; 
#刷新权限 
flush privileges; 

0

评论区