Automatically create mysql user and database for new WHM accounts?

joachim.n

Registered
Jun 18, 2009
4
0
51
Is there a way to set up WHM so when a new account is created it automatically creates a MySQL account too, and ideally a new database for the user?

I've looked through all the database-related settings and I can't find anything.
 

joachim.n

Registered
Jun 18, 2009
4
0
51
I take it back -- the users are already there :)

Any way to create a DB for them automatically though?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
13
313
Houston, TX
cPanel Access Level
Root Administrator
You can add this to the postwwwacct script to add a database upon account creation.
Furthermore, you can call our APIs to create a database user and the database. I recommend creating a separate database user so when one day the user changes their cPanel password, they aren't confused as to why their databases have suddenly stopped working.