您的位置 首页 mysql

mysql8 yum 方式安装

mysql 8 yum 方式安装

https://zhuanlan.zhihu.com/p/623778183?utm_id=0

1 配置MySQL软件源

wget  https://dev.mysql.com/get/mysql80-community-release-el7-9.noarch.rpm

rpm -ivh mysql80-community-release-el7-9.noarch.rpm

 

2 安装MySQL

yum -y install mysql-community-server

3 启动数据库

systemctl enable --now mysqld

4 查看MySQL默认的初始化密码

grep 'temporary password' /var/log/mysqld.log

5 修改MySQL的默认密码

ALTER USER USER() IDENTIFIED BY 'baimeidashu@2023MySQL';
SHOW VARIABLES LIKE '%validate_password.policy%';
SET GLOBAL validate_password.policy=0; -- 修改策略模式
SHOW VARIABLES LIKE '%validate_password.policy%';
ALTER USER USER() IDENTIFIED BY 'baimeidashu';

QUIT

 

创建mysqld-exporter的授权用户

CREATE USER 'mysql_exporter'@'localhost'  IDENTIFIED WITH mysql_native_password BY 'baimeidashu' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'mysql_exporter'@'localhost';

QUIT

mysql -umysql_exporter –pbaimeidashu

 

检查

 

select user,host,plugin,authentication_string  from mysql.user;

 

 

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章