linux yum安装mysql8.0

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/PHP_zhQ/article/details/86522170

首先下载包https://dev.mysql.com/downloads/repo/yum/

mysql80-community-release-el7-1.noarch.rpm

rpm -Uvh mysql80-community-release-el7-1.noarch.rpm

yum install mysql-community-server

...

service mysqld start

mysql -uroot -p       

需要输入密码 

利用 grep 'temporary password' /var/log/mysqld.log 生成一个临时密码

A temporary password is generated for root@localhost: bl?4sqj(:/dJ

登陆成功 第一步就要修改密码  不然报错

这里对密码有规则限制 简单的密码也不会通过  

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'dog123456';

可以修改密码规则

mysql> set global validate_password.policy=0; 
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';
Query OK, 0 rows affected (0.07 sec)

长度也有限制

validate_password.length | 8 

可以修改:

mysql> set global validate_password.length =6; 

安装的目录在/var/lib/mysql

 

 

 

 

展开阅读全文

没有更多推荐了,返回首页