Emanuil Rusev
Emanuil Rusev

Reputation: 35265

User hosts in MySQL

Here's a screenshot of the first three columns of the users table in the mysql DB available from phpMyAdmin in a XAMPP installation.

What's the purpose of the Host values?

enter image description here

Upvotes: 1

Views: 87

Answers (2)

Nemoden
Nemoden

Reputation: 9056

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

Upvotes: 2

Vlad
Vlad

Reputation: 10780

The host column states from which host the user is allowed to connect. See documentation.

Upvotes: 3

Related Questions