Web Hosting Talk







View Full Version : Access denied - Creating MySQL


Bazuuka
08-31-2002, 10:01 AM
I am want to create a mySQL database from a PHP script using mysql_create_db. when I test the scripts on my local computer it works fine and creates the database, but when I upload the script to my webhost the script cant create the database it gets a "Access Denied to..." error.

I have unlimeted mysql in my hosting package, I can create them manualy from the CPANEL but cant create them with my php script.

What can I do to be able to create mySQL databases from a PHP Script.

Thanks

sitekeeper
08-31-2002, 10:43 AM
Are you using your cPanel user name and password in the script?

Bazuuka
08-31-2002, 11:05 AM
Originally posted by sitekeeper
Are you using your cPanel user name and password in the script?

I tried that but it didnt work, I got a:

Access denied for user: xxxx@localhost' to database 'xxxxx'

error.

:confused:

kunal
08-31-2002, 12:16 PM
Hi,

To create a dbase, you need to have root access to mysql.. which you wouldnt have in a virtual hosting environment. You need to ask your host to create the dbase for you, or do it via cpanel.

kinda sucks, i know...
Kunal

Bazuuka
08-31-2002, 12:35 PM
Originally posted by kunal
Hi,

To create a dbase, you need to have root access to mysql.. which you wouldnt have in a virtual hosting environment. You need to ask your host to create the dbase for you, or do it via cpanel.

kinda sucks, i know...
Kunal

Thanks kunal.

I will have to create them manually :(