Linux8yum安装mysql
Linux8yum安装报错解决
yum安装流程
首先下载mysql的yum配置
wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安装mysql源
yum -y install mysql57-community-release-el7-11.noarch.rpm
安装mysql
yum -y install mysql-server --nogpgcheck --nogpgcheck
启动mysql
systemctl start mysqld.service (注:启动)
systemctl status mysql.service (注:查看状态)
systemctl stop mysql.service (注:停止状态)
查看mysql临时密码
cat /var/log/mysqld.log| grep password
[root@localhost mysql]# cat /var/log/mysqld.log| grep password
2023-10-13T02:13:40.394646Z 1 [Note] A temporary password is generated for root@localhost: p3gihsXmnt?8
进入mysql输入临时密码
mysql -uroot -p
进入后修改mysql密码
ALTER USER USER() IDENTIFIED BY '123456Admin@123';
给其他机器授权能够访问mysql服务
grant all privileges on *.* to 'root'@'%' identified by '123456Admin@123' with grant option;flush privileges;(注:刷新配置)
修改密码策略
set global validate_password_policy=0;
set global validate_password_length=1;flush privileges;
修改root用户的密码为root
alter user 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.00 sec)
修改localhost以外,远程连接用户的密码为root
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
完结❀