Reputation: 501
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?
Upvotes: 2
Views: 2401
Reputation: 30545
GRANT ALL PRIVILEGES ON `osticket`.* TO 'osticket'@localhost;
be aware of the quotations
`osticket`.*
Upvotes: 5