database permission by php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

database permission by php

Post by m2babaey »

Hi
when installing a cms, I want to create a database (by the php code)
but in cpanel, when we create the database, we have to add the user to the database
so is it possible to create the database by php code and add the user to it?
thanks for your help
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: database permission by php

Post by JAB Creations »

1.) Go to cPanel.

2.) Click "MySQL® Databases".

3.) Create a database.

4.) Create a user.

5.) Associate the database with the user.

The fifth step is a bit tricky but all you have to do is look on the page for Add Users To Your Databases: and select the database and the user on the two select menus below and then click on the button that says, 'Add User to Database'.

Once you do this all you have to do is make sure you're using the correct credentials to connect to the database. :)
Post Reply