首先进入MySQL官网下载rpm安装包
用yum install mysql80-community-release-el7-3.noarch.rpm 安装
yum repolist all|grep mysql可以看到仓库默认开启的是8.0,
yum install yum-utils –y 安装yum工具
我们要安装的是5.7
yum-config-manager --disable mysql80-community关闭8.0版本
yum-config-manager --enable mysql57-community开启5.7版本
yum install mysql-community-server –y安装
systemctl start mysqld启动
systemctl status mysqld查看状态
ps -ef|grep mysqld查看进程
cat /var/log/mysqld.log查看数据库默认密码
登录改密码
mysql –uroot –p******
alter user 'root'@'localhost' indentified by '******';
创建数据库
create database wordpress;
查看数据库
show databases;
查看用户权限
select user,host from mysql.user;
create user 'wordpress'@'%' identified by '******';创建一个用户
grant all privileges on wordpress.* to 'wordpress'@'%';给用户权限
远程访问数据库成功。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有