User hosts in MySQL
Here's a screenshot of the first three columns of the users
table in the mysql
DB availa开发者_运维百科ble from phpMyAdmin in a XAMPP installation.
What's the purpose of the Host values?
The host
column states from which host the user is allowed to connect. See documentation.
You can have one username on multiple hosts, so you can decide whether to give this user extra-permissions or not.
For example you have user emanuil
and you grant him all privileges on localhost, but if somebody connects from differen host with username emanuil
, you wouldn't give him drop table
privelege because of security reasons
'emanuil'@'127.0.0.1' - All privileges
'emanuil'@'%' - All priveleges except drop table
精彩评论