Creating Database permison
Moderator: General Moderators
Creating Database permison
Hi,
I wonder if someone could help
i have a php script to make a database, but the error is that the user im connected as does not have persmison to access this database im trying to create but you have to asign users to a database in cpanel. so how can you create a database if the user is denied.
thanks reece
I wonder if someone could help
i have a php script to make a database, but the error is that the user im connected as does not have persmison to access this database im trying to create but you have to asign users to a database in cpanel. so how can you create a database if the user is denied.
thanks reece
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
So you want to do an action that a user does not have priviledges to? impossible.reecec wrote:thanks, but the user does have full priveleges but only when you asign users to a database. so how can you create a database when loged in as a user that isnt yet set up for this database.
also yes i can do it in cpanel but i need it to be in the script
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
This sounds like a hosted account that likes to charge for extra databases. They typically take away your right to create databases because it takes revenue away from them.
If you have the right to make more databases in your account, or if you have root level privilege to your database server (doubtful on shared accounts) I would say just change your user's permission in phpMyAdmin or even at the CLI. but that would require you having sufficient privileges (under your logged in account) to GRANT permissions.
If you have the right to make more databases in your account, or if you have root level privilege to your database server (doubtful on shared accounts) I would say just change your user's permission in phpMyAdmin or even at the CLI. but that would require you having sufficient privileges (under your logged in account) to GRANT permissions.
Everah wrote:This sounds like a hosted account that likes to charge for extra databases. They typically take away your right to create databases because it takes revenue away from them.
If you have the right to make more databases in your account, or if you have root level privilege to your database server (doubtful on shared accounts) I would say just change your user's permission in phpMyAdmin or even at the CLI. but that would require you having sufficient privileges (under your logged in account) to GRANT permissions.
the last part from what everah said is true so would i be right in saying this:
When your on cpanel and you create a database that is on there server so basicly root access but when im loged in as a user using php i havent got priveleges per user to create a database. i would need a server with root access.
but im sure many scripts need to create databases
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
cPanel should have nothing to do with your ability to make a database. That permission should be at the database level. I think.reecec wrote:Hi, hope you all had a good xmas
i found out you cant make databases in php when your hosting has cpanel so i have used cUrl to create it in cpanel through php
thanks reece
How were you able to do it with cURL?
everah, I have made it so it logs into cpanel and in the address it contains the db name
it was from this website http://www.zubrag.com/scripts/cpanel-da ... reator.php
___
feyd, sorry but i dont think you can comment like that if you dont know the application im trying to create, the database is a one of creation in sign up they see and know noting about this.
thanks reece
Code: Select all
$resultdata = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$db_name_data'");it was from this website http://www.zubrag.com/scripts/cpanel-da ... reator.php
___
feyd, sorry but i dont think you can comment like that if you dont know the application im trying to create, the database is a one of creation in sign up they see and know noting about this.
thanks reece