Your cart is currently empty!
MySQL: Permissions
Create a user:
CREATE USER [email protected] IDENTIFIED BY 'password';
Rename a user:
RENAME USER [email protected] TO test@'%';
Grant all:
GRANT ALL PRIVILEGES ON <database>.<table> TO <user>@<host>;
Grant all to a database starts with “test_”:
GRANT ALL PRIVILEGES ON `test\_%`.* TO test@localhost;
From MySQL website:
The
_
and%
wildcards are permitted when specifying database names inGRANT
statements that grant privileges at the database level (GRANT ... ON
). This means, for example, that to use adb_name
.*_
character as part of a database name, specify it using the\
escape character as\_
in theGRANT
statement, to prevent the user from being able to access additional databases matching the wildcard pattern (for example,GRANT ... ON `foo\_bar`.* TO ...
).
REFERENCES:
Leave a Reply