Mysql – Can’t create database even with all privileges

mariadbMySQLpermissions

[mariaDB on RedHat 7.7]

I just want to create a new database, but found "access denied":

create database lamp_k;

ERROR 1044 (42000): Access denied for user 'lamp'@'localhost' to database 'lamp_k'

These are my privileges:

+-------------------------------------------------------------------------------------------------------------+
| Grants for lamp@localhost                                                                                   |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'lamp'@'localhost' IDENTIFIED BY PASSWORD '*F90C7030DCB590F7C8E0ED955DA6222DE699A9E8' |
| GRANT ALL PRIVILEGES ON `lamp_*`.* TO 'lamp'@'localhost' WITH GRANT OPTION                                  |
+-------------------------------------------------------------------------------------------------------------+

Best Answer

Before the changes actually take action, you need to run

FLUSH PRIVILEGES

EDIT: Just saw that you tried to grant Privileges on a database which doesn't exists. You need to give them global privileges to create databases.