create host table in mysql for user access with phpmyadmin

mysql, phpmyadmin

Solution

As of MySQL 5.6.7 the host table is no longer included in the installation of MySQL.

- https://dev.mysql.com/doc/refman/5.6/en/grant-tables.html

It used to be that you could use the host table (located at `mysql`.`host`) to define allowed hosts for a specific database. It worked something like this:

- A user would try to do something (let's say INSERT).

- The server would look in the `mysql`.`user` table to see if the user had global INSERT privileges.

- If the user didn't have global INSERT privileges the server would then look in the `mysql`.`db` table to see if the user had DB specific privileges.

- If the user had DB specific privileges and the `mysql`.`db`.`Host` field was empty the server would look in the `mysql`.`host` table for any hosts that matched the `Db` field of the `mysql`.`db`.`Db` field.

- Assuming it found a match it would allow the INSERT.

If you want to have multiple hosts for a given user read the following:

- http://dev.mysql.com/doc/refman/5.6/en/account-names.html

Since a MySQL username is actually 'name'@'host' you could always add multiple users with the same name but different hosts and give them the same privileges.

Why does phpmyadmin still include this feature?

I can only assume that it is for legacy support.

Problem

I am trying to create a host table in phpMyAdmin for user access and while there is this option below, I cannot find this table to add hosts nor any instructions to create one. Am I missing something? Field: Use Host Table Description: When host table is used, this field is ignored and values stored in Host table are used instead. Thank you in advance

Original source