centos7.5常见的mysql方式

mysql8.x版本 

在linux的centos7.5系统上安装mysql_centos7.5安装mysql-优快云博客

mysql5.7 版本

​​​​​​​​​​​​​​CentOS 7.5系统安装使用Mysql 5.7数据库-阿里云开发者社区,其中需要补充以下两点:

1)如果安装mysql的时候报错Failing package is: mysql-community-client-5.7.40-1.el7.x86_64 GPG Keys are configured as,密钥过期,要按以下方法:

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

2)查询初始密码的时候如下:

[root@VM-2-185-centos bin]# grep 'temporary password'  /var/log/mysqld.log
2023-12-05T05:45:29.627475Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: hTTS#V__H3xt

修改系统密码,授权一个账户远程访问。

mysql> alter user root@"localhost" identified by 'Fan.88888';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to 'root'@'%' identified by 'Fan.88888' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值