Mysql – Meaning of various user account privileges in phpMyAdmin

MySQLphpmyadmin

Reference the attached screenshot:

enter image description here

  1. I created a non-root user, and gave it all privileges to a database. It now has All Privileges of Typeglobal and database-specific. What's the difference between these 2 "Types"?
  2. Why three root User names? What's the purpose of having so many?

Best Answer

phpMyAdmin shows you the privileges of the users with regard to the underlying MySQL database instance to which you're connected. So, the answers don't come from phpMyAdmin, but from MySQL.

  1. I created a non-root user, and gave it all privileges to a database. It now has "All" privileges of "Type" -- "global" and "database-specific". What's the difference between these 2 "Types"?

You can have one user have certain privileges for a given database (that's the database-specific, while s/he has some others for all the databases (that's the global). Someone with global privileges can, for instance, create new databases. That's something that person won't be able to do it s/he has only database-specific privileges.

  1. Why three "root" "User names"? What's the purpose of having so many?

In MySQL you can give different privileges to users based not only on the username, but also based on the IP address or DNS name from which they connect. In principle, localhost represents your local machine (or, in actuality, the machine where phpMyAdmin is running), accessed either via IP protocol version 4 or version 6, 127.0.0.1 represents localhost through IPv4, and ::1 represents your local machine via IPv6 (actually, they represent the virtua loopback interface, but don't bother with the subtle distinction). However, localhost could be changed on the hosts file of the machine to have a different meaning (don't do it or your machine might become inoperative!).

You have the three different settings (I think that by default) because the client connecting to your database might be using either an IPv4 address, an IPv6 address, or an address that maps to the localhost name. This is done so that, no matter which is the connection method, the root user can access MySQL and setup and change the database(s).

If you would like the user root to be able to connect from a remote computer (apart from changing some default configuration parameters), you would need to give him/her permissions to connect from a certain IP address (such as 123.123.123.123). Check the account names documentation from MySQL for how to specify IP addresses, DNS names, or wildcards.