gpt4 book ai didi

mysql - 无法向用户授予数据库权限

转载 作者:行者123 更新时间:2023-12-03 08:35:52 26 4
gpt4 key购买 nike

我对自己遇到的问题感到困惑。我创建了一个数据库,创建了一个用户,并想授予该用户对数据库的所有权限。无论如何,我遇到了语法错误,但我相当确定没有语法错误。

MariaDB [(none)]> SELECT User FROM mysql.user;
+------------+
| User |
+------------+
| osticket |
| phpmyadmin |
| root |
+------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| osticket |
| performance_schema |
| phpmyadmin |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON 'osticket'.* TO 'osticket'@localhost;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''osticket'.* TO 'osticket'@localhost' at line 1
MariaDB [(none)]>

我也将 localhost 更改为“localhost”以确保无济于事。这是怎么回事?

最佳答案

GRANT ALL PRIVILEGES ON `osticket`.* TO 'osticket'@localhost;

注意引用

`osticket`.*

关于mysql - 无法向用户授予数据库权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63886530/

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