Jump to content

Recommended Posts

Posted

i'm trying to install a script on a subdomain and am getting the following error on the create file: "Unable to select database"

 

the config file has the following:

 

$dbhost = "localhost"; // usually this is localhost but if it doesn't work, check with your hosting provider

$dbname = "dbname"; // the name of the databse you want to put the phpFanBase tables in

$dbuser = "username"; // your MySQL username (must have access to database above)

$dbpass = "password"; // your MySQL passwor

 

assuming i've created the dtabase "name"

with the username "name2"

and the password "pw100"

 

what values do i put there to get the script to connect to the database? in my cp panel, the database is showing up as domain_name

 

and the user is showing up as "domain_name2"

 

but when i tried those values it didn't work. it didn't work without the domain_ either. i'm relatively new to php and mysql, but i have gotten this script to work on another domain, so, please help? someone?

 

thanks

Posted

for dbase name are you using cpanelname_dbasename

and for username cpanelname_username

 

Also, did you assign a user to the database you created? If you didnt you need to do that first vis manage mysql in your coanel

Guest schussat
Posted
$dbhost = "localhost"; // usually this is localhost but if it doesn't work, check with your hosting provider

$dbname = "dbname";  // the name of the databse you want to put the phpFanBase tables in

$dbuser = "username"; // your MySQL username (must have access to database above)

$dbpass = "password"; // your MySQL passwor

This is off the top of my head, but I think it's correct: When you specify the database name and user name, you need to preface them with your cpanel login. I think this is because of the shared hosting setup. So, assuming your cpanel name is foobar, your username is joe, and the database is dbase, your username and database name would look like (include the underscores):

 

>$dbname = "foobar_dbase";
$dbuser = "foobar_joe";

 

Be sure to create the matching user and the database in cpanel -- and you should be all set to go.

 

-Alan

 

PS: Edit: Doh! MikeH beat me to it!

Posted

yea, created the database saxykam, and gave it the user name saxykam. in my cpanel, they're showing up as:

 

database: domynoe_saxykam

username: domynoe_saxykam

 

 

that's originally how i put them in the script and it came up with the unable to select a database error.

 

sigh . . . . i'll try it again.

Posted

doh!

 

 

that was the problem. thanks. since it was showing up next to the databse name i assumed the use was already ssigned. *smacks forehead*

 

 

 

told you i was new at this php/mysql thing. give me html and ssi and all that and i'm fine. lol

Posted

thank you. i'm quite proud of it.

 

i'm actually quite the busy girl between my personal forums, my writing group forums, some market forums, my writing, my 4 websites, my children's and husband's websites, ummm . . . yea. i'll see about poking about once in awhile, but don't count me as a regular. lol

 

and speaking of writing, off to get some done. yay.

 

thanks again for the help. :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...