mysql8安装配置命令
mysql 8 安装配置命令
登录mysql
mysql -u root -p
初始密码默认是/var/log/mysqld.log,到临时密码
cat /var/log/mysqld.log
重新设置密码
set global validate_password.policy=0;
set global validate_password.length=4;
ALTER user ‘root’@‘localhost’ IDENTIFIED BY ‘Hujun123#’;
SHOW VARIABLES LIKE ‘validate_password%’;
use mysql;
select user,host from user;
update user set host=’%’ where user=‘root’ and host=‘localhost’;
mysql下载配置GRANT ALL PRIVILEGES ON . TO ‘root’@’%’;
FLUSH PRIVILEGES;
修改加密规则
mysql8新版本发布,安装后出现2059错误,原因为安装时选择了强加密规则caching_sha2_password 与之前的mysql5.7的mysql_native_password规则不同,navicate驱动⽬前不⽀持新加密规则
select user,host,plugin from user where user=‘root’;
#修改加密规则
ALTER USER ‘root’@’%’ IDENTIFIED BY ‘Hujun123#’ PASSWORD EXPIRE NEVER;
#更新⼀下⽤户的密码
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘Hujun123#’; FLUSH PRIVILEGES;
创建⽤户
CREATE USER ‘username’@‘host’ IDENTIFIED BY ‘password’;

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。