Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where does cPanel/WHM store its associations between users and their MySQL databases? I can't seem to find anything in /home/$USER, or /var/cpanel, or /etc/..

share|improve this question

closed as off-topic by HopelessN00b Jan 13 '15 at 20:47

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

This question appears to be off-topic because it is about working with a service provider's management interface, such as cPanel. – HopelessN00b Jan 13 '15 at 20:47
up vote 1 down vote accepted

In the newer cPanel versions, cPanel stores this config in /var/cpanel/databases/username.yml file.

share|improve this answer

Last time I was unfortunate enough to use cPanel, it just looked for any databases that matched /^<USERNAME>_.*$/

share|improve this answer

In the mysql database, there is a table called "db". In this table, it shows which users have which accesses to which DBs. This is most probably where WHM stores the actual ACLs that allow user1 access to his DB, and his DB only.

Or, are you asking where it stores the properties of "which DBs to show in the control panel for this user"? If so, that may be best posed to the CPanel user list. I think that is in the CPanel database somewhere.

share|improve this answer
The "db" table in the "mysql" database is used by MySQL to determine which mysql users have access to which databases. Im interested in knowing how cPanel determines which databases are "owned" by a given cpanel user. For example, when you create a backup for a user, cPanel will include in the backup the databases that the user "owns". How does it know which ones? – tylerl Nov 18 '09 at 18:51
It keeps its own set of files to handle which users own which databases. It is in the CPanel code itself, and located in the CPanel system directories somewhere. Your best bet would be to ask a CPanel specialist on their user boards or something. I don't have enough experience to guess well. – samuelstringham Nov 20 '09 at 19:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.