gpt4 book ai didi

mysql 向不工作的用户授予 sql 脚本

转载 作者:太空宇宙 更新时间:2023-11-03 12:11:04 24 4
gpt4 key购买 nike

标题说明了一切,这是我的代码

GRANT SELECT, INSERT, UPDATE, DELETE ON 'database_name' TO 'mysqluser'@'111.111.111.111';

它说

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 near ''database_name' TO 'mysqluser'@'111.111.111.111'' at line 1

最佳答案

这个:

GRANT SELECT, INSERT, UPDATE, DELETE ON 'database_name' TO 'mysqluser'@'111.111.111.111';

应该是:

GRANT ALL ON 'database_name'.* TO 'mysqluser'@'111.111.111.111';

在您的特定情况下(在我的 mysql 服务器上测试):

GRANT SELECT, INSERT, UPDATE, DELETE ON database_name.* TO 'mysqluser'@'111.111.111.111';

关于mysql 向不工作的用户授予 sql 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24187663/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com