创建用户

1
CREATE USER user1@127.0.0.1 IDENTIFIED  WITH mysql_native_password BY '123456';

user1 用户名

127.0.0.1 允许的IP地址。 IPV6::1 远程 % 本地 localhost127.0.0.1

mysql_native_password 加密方式。 旧的mysql_native_password,新的caching_sha2_password

修改密码

1
ALTER USER 'root'@'::1' IDENTIFIED WITH mysql_native_password BY '123456';