错误 1064 (4200) - 当我在 MySQL 中输入 GRANT ALL 请求时
Error 1064 (4200) - when I type in a GRANT ALL request in MySQL
GRANT ALL ON uesrName.* TO username@hostname.mysql.pythonanywhere-services.com;
ERROR 1064 (42000):您的 SQL 语法有误;查看与您的 MySQL 服务器版本对应的手册,了解在 '-services.co 附近使用的正确语法
m' 在第 1 行
谁能告诉我,是不是“-”导致我的请求失败。
我使用了 pythonanwhere.com 提供的正确用户名和主机名
我在执行此任务时使用 pythonanywhere.coms GUI。
Several objects within GRANT statements are subject to quoting, although quoting is optional in many cases: Account, database, table, column, and routine names. For example, if a user_name or host_name value in an account name is legal as an unquoted identifier, you need not quote it. However, quotation marks are necessary to specify a user_name string containing special characters (such as -), or a host_name string containing special characters or wildcard characters (such as %); for example, 'test-user'@'%.com'. Quote the user name and host name separately.
您必须将主机名引用为
username@'hostname.mysql.pythonanywhere-services.com'
没有引用:
mysql> GRANT ALL ON uesrName.* TO username@hostname.mysql.pythonanywhere-services.com;
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 '-services.com' at line 1
引述:
mysql> GRANT ALL ON uesrName.* TO username@'hostname.mysql.pythonanywhere-services.com';
Query OK, 0 rows affected (0.00 sec)
GRANT ALL ON uesrName.* TO username@hostname.mysql.pythonanywhere-services.com;
ERROR 1064 (42000):您的 SQL 语法有误;查看与您的 MySQL 服务器版本对应的手册,了解在 '-services.co 附近使用的正确语法 m' 在第 1 行
谁能告诉我,是不是“-”导致我的请求失败。
我使用了 pythonanwhere.com 提供的正确用户名和主机名 我在执行此任务时使用 pythonanywhere.coms GUI。
Several objects within GRANT statements are subject to quoting, although quoting is optional in many cases: Account, database, table, column, and routine names. For example, if a user_name or host_name value in an account name is legal as an unquoted identifier, you need not quote it. However, quotation marks are necessary to specify a user_name string containing special characters (such as -), or a host_name string containing special characters or wildcard characters (such as %); for example, 'test-user'@'%.com'. Quote the user name and host name separately.
您必须将主机名引用为
username@'hostname.mysql.pythonanywhere-services.com'
没有引用:
mysql> GRANT ALL ON uesrName.* TO username@hostname.mysql.pythonanywhere-services.com;
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 '-services.com' at line 1
引述:
mysql> GRANT ALL ON uesrName.* TO username@'hostname.mysql.pythonanywhere-services.com';
Query OK, 0 rows affected (0.00 sec)