centos7.5常见的mysql方式

mysql8.x版本 

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

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)

你可能感兴趣的:(linux,mysql)