mysql8.0远程访问授权

在安设置mysql8.0远程访问过程中遇到的问题:

1、ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '. to 'username'@'%'' at line 1

解决方案:

1、新建远程访问用户:create user 'username'@'%' identified by 'password';

2、给远程访问用户授权:GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';

3、刷新权限:FLUSH PRIVILEGES;

2、ERROR 1410 (42000): You are not allowed to create a user with GRANT

msyql8.0好像自己给自己授权不行了,新建一个账号吧,并给这个账号授权。
 

最后还有一个问题,如果用Navicat连接的回报不支持caching_sha2_password验证方式的错误。

将远程访问用户的验证方式改为: msyql_native_password 

执行:

ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

FLUSH PRIVILEGES;

你可能感兴趣的:(mysql)