当前位置:网站首页>Mysql8.0 authorized remote login

Mysql8.0 authorized remote login

2022-07-24 09:40:00 liuyunshengsir

problem

Always used before mysql5.7 Remote authorized login , Later, I changed mysql8.0 The original authorization method reported an error

mysql> GRANT ALL ON *.* to [email protected]'%' IDENTIFIED BY 'AAbb1122!!';
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 'IDENTIFIED BY 'AAbb1122!!'' at line 1

Cause analysis

8.0 Authorization methods are different , You can't delegate to yourself

First create another user

create user 'user0001'@'%' identified by 'User0001!';

grant all privileges on *.*  to  'user0001'@'%'  identified by 'User0001!'  with grant option;

GRANT ALL PRIVILEGES ON *.* TO 'user0001'@'%';


FLUSH PRIVILEGES;

ALTER USER 'user0001'@'%' IDENTIFIED WITH mysql_native_password BY 'User0001!';


select host, user, authentication_string, plugin from user;

原网站

版权声明
本文为[liuyunshengsir]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207221511000702.html