简体   繁体   中英

Cannot grant privileges to a user on a database

I'm baffled by the problem I'm having. I created a database, created a user, and want to grant the user all privileges on the database. One way or another, I'm having syntax errors, while I'm fairly sure there is no syntax error.

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)]>

I also changed localhost to 'localhost' to be sure, no avail. What's going on here?

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

注意报价

`osticket`.*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM