Web Hosting Talk







View Full Version : Auto Creation of MYSQL Database With New CPanel Account


qualityinterfaces
07-18-2007, 02:04 PM
I am currently working on my own hosting web site using reseller accounts, I have auto signup and such already created and am using ClientEx and WHM. I want to offer cms specific hosting so when my users sign up it automatically has the cms installed, i know that i need to use skeleton directories to put all the php files in place, and have already done so, my main question is to get it whm to set up a mysql database automatically. Any suggestions?

cPanelDavidG
07-18-2007, 02:24 PM
I am currently working on my own hosting web site using reseller accounts, I have auto signup and such already created and am using ClientEx and WHM. I want to offer cms specific hosting so when my users sign up it automatically has the cms installed, i know that i need to use skeleton directories to put all the php files in place, and have already done so, my main question is to get it whm to set up a mysql database automatically. Any suggestions?

You can use a hook (/scripts/postwwwacct - documentation: http://www.cpanel.net/support/docs/hooks.htm#postwww) which will automatically be executed each time you create an account. It's a shell script, and from there you can create and dump databases as needed.

However, if I was doing this, I'd create a simple installation script (probably in PHP in this case) that the first time the user goes to use their website, it automatically installs everything. This reduces the complexity of needing to deal with the inner workings of cPanel/WHM.

qualityinterfaces
07-18-2007, 02:37 PM
David,

I see what you mean, I will also give that route a go I suppose, I really don't know much about doing this though, and would appreciate any links that could point me in the right direction. Thanks for your help.

DaveDark
07-19-2007, 11:15 AM
David,

I see what you mean, I will also give that route a go I suppose, I really don't know much about doing this though, and would appreciate any links that could point me in the right direction. Thanks for your help.

You'll have to research using Perl or PHP to create MySQL Databases. I'll plug the Perl route: http://search.cpan.org/~capttofu/DBD-mysql-4.005/lib/DBD/mysql.pm

Rent-It-Sale-It
08-03-2007, 02:17 AM
what is a good Auto Account Creation software to hosting?