Posted on


All About Technology

I  have come across a project in which i have to create database and its associated user dynamically.

Let us store our cpanel settings in variable

$box_num = 000;
$cPanel_user = ‘XXXXXXX’ ;  // cpanel username
$cPanel_pass = urlencode(‘YYYYYYYY’); // cpanel password

//Database to create

$userDb = ‘test’;
$db = $cPanel_user.’_’. $userDb; //  e.g XXXXXXX_test

$db_user = $cPanel_user.’_myuser’;  // username to be created
$db_pass = ‘mypass’;  // password to be created

//Permission must stay in uppercase. This will give the user full permissions. Remove the ones that you don’t want.


Now let us define the host path, replace domain name with your domain name

$host = ‘http://’ . $cPanel_user . ‘:’ …

View original post 136 more words


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s