如何从任何主机远程访问 mysql 服务器?

如何从任何主机远程访问 mysql 服务器?

我跟着78246
当我做

mysql> GRANT ALL PRIVILEGES ON *.* for '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 'for 'root'@'%' IDENTIFIED BY 'password'' at line 1

我怎样才能使它工作?

答案1

应该是to,而不是for。

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; 

相关内容