-
重要更改:默认字符集已从latin1更改为utf8mb4。这些系统变量受到影响:character_set_server和 character_set_database系统变量的默认值已从latin1更改为utf8mb4。collation_server和collation_database系统变量的默认值已从latin1_swedish_ci更改为utf8mb4_0900_ai_ci
-
授权
grant all privileges on . to ‘admin’@’%’ with grant option; -
密码限定修改变成
1、set global validate_password.policy=0;
2、set global validate_password.length=1; -
mysql8改完密码ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
解决:
跳过mysql密码访问
vim /etc/my.cnf 最后添加skip-grant-tables 保存退出
重启mysqld
进入mysql -uroot -p 回车
select * from mysql.user where user=‘root’\G
如果显示数字则update mysql.user set authentication_string='' where user='root';
flush privileges; 刷新权限
再alter user 'root'@'localhost' identified by 'LT@19l..';
就可以了
然后把skip-grant-tables注释 重启服务 -
navicat连接不了数据库
原因:出现连接失败的原因:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password
解决:
1.升级navicat
2.修改用户密码规则 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
#更新一下用户的密码这里的password为你修改的新密码。
FLUSH PRIVILEGES; #刷新权限,使自己的修改生效。
-
mysql的二进制日志关闭
查询语句 show variables like ‘log_bin’;
正常此变量修改不了只能配置文件修改
编辑/etc/my.cnf
添加skip-log-bin
重启服务即可