#修改密码规则和长度限制;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'aaaAAA111.';
set global validate_password.policy=0;
set global validate_password.length=1;
#修改密码为 123456,指令如下;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
#默认 root 用户不能远程登录,需要更新密码信息;
use mysql;
update mysql.user set host='%' where user="root";
use mysql;
grant system_user on *.* to 'root';
flush privileges;
#若在想修改 root 密码,命令如下;
update user set authentication_string=password("root") where user='root' and
host='localhost';
#mysql8.0 之前的版本中加密规则是 mysql_native_password, 而在 mysql8 之后,加密规则是
caching_sha2_password
使用 navicat 进行 mysql 登录时出现弹窗报错
grant system_user on *.* to 'root';
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
1.2配置主从
修改mysql的配置文件
分别将server-id 设置不同
在master设置 bin-log
配置和之前的一样