MySql:Grant
lastmod 2018-09-13created 2018-09-131 edits
How to use the GRANT statement in MySQL.
Syntax
grant [AUTHORITY] privileges on [DB].[TABLE] to [ID]@[ADDRESS] identified by [PASSWORD] with grant option;
Example
Param
- Authority
- Privilege setting.
- all, for all privileges
- Otherwise, you can selectively list select, update, delete, insert..., etc.
- DB
- Accessible db.
- For all DBs, enter
*.
- For all DBs, enter
- TABLE
- Accessible table.
- For all tables, enter
*.
- For all tables, enter
- ID
- ID to add.
- ADDRESS
- Address allowed to connect.
- To apply to all addresses, enter
%. To apply to local only, enterlocalhost.
- To apply to all addresses, enter
- PASSWORD
- Password
- Must be written between
'and'. (ex:'1234')
- Must be written between
Warning
To apply the changes, you must restart the DB or enter flush privileges;.