Linux里安装的MySQL开启访问权限设置,使用命令:
grant all on *.* to 'root'@'%' identified by 'password';
然后一直报错
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 'Root777!'' at line 1
解决办法:MySQL8开始不能隐式使用创建grant命令。
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'PASSWORD';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANTOPTION;
mysql> FLUSH PRIVILEGES;