domynoe Posted November 3, 2003 Posted November 3, 2003 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 Quote
TCH-Dick Posted November 3, 2003 Posted November 3, 2003 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 Quote
Guest schussat Posted November 3, 2003 Posted November 3, 2003 $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! Quote
domynoe Posted November 3, 2003 Author Posted November 3, 2003 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. Quote
TCH-JimE Posted November 3, 2003 Posted November 3, 2003 Have you selected the username to the database rather then just created it? Jim Quote
domynoe Posted November 3, 2003 Author Posted November 3, 2003 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 Quote
TCH-Don Posted November 3, 2003 Posted November 3, 2003 Welcome to the family thats a beautiful site you have! Hope you will bea regular here, we really are just like family here. Quote
domynoe Posted November 3, 2003 Author Posted November 3, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.