PDA

View Full Version : Can't connect to database



glennybee
Mon 11th Feb '08, 6:06pm
I know you guys must be sick of reading database threads but I've been at this for hours now. :(

I'm at step 2 of the installation and it keeps saying...

The database has failed to connect because you do not have permission to connect to the server. Please confirm the values entered in the 'includes/config.php' file.


Now I know it has something to do with the /includes/config.php file, $config['MasterServer']['username'] & $config['MasterServer']['password'].

When I created the database in my cpanel and given it a name. Lets say that it's called 'database1'. Lets say that my logon username for my hosting is 'username1'.

When I created the 'database1' username, it shows as 'username1_database1'.

When I created the username for the database, I called it 'root'. Now this shows as 'username1_root'. I've attached the username to the database.

Now what I'm confused at is....in the config.php file, do I put the master dbusername as 'root' or 'username1_root'. And do I put the dbname as 'database1' or 'username1_database1'.

LMAO...I'm confused writing this, no wonder it's not working.

If you can understand this, I'd appreciate any help.

My hosting is hostgator.

Also, how long should it take to connect to the database on step 2? My install sits there for about 60s then errors. Should it be almost instant?

Thanks
Glen

zappsan
Mon 11th Feb '08, 8:28pm
Yes, you've got to use 'username1_root' and 'username1_database1', that's how it works for me at least.
The conenction should actually be established in a few seconds. It never has taken 60 seconds for me (actually much shorter most of the time).

DieselTruck
Mon 11th Feb '08, 10:22pm
Im having the same problems. I haven't got it to work yet..

DieselTruck
Mon 11th Feb '08, 10:52pm
I got mine going Glenn.

If your still having trouble. Post here and i'll do my best to help you out from what I just learned!

glennybee
Tue 12th Feb '08, 12:34am
Yes you were correct, I needed to use 'username1_root' and 'username1_database1' in the config.php file.

I also had changed the port to the port of my cpanel when it should have stayed at 3306.

All sorted now.

Thanks for the replies guys. :)

dochall22
Tue 12th Feb '08, 1:07pm
what program do you guys use to open the files to edit them? My computer wont let me open the files.

zappsan
Tue 12th Feb '08, 1:35pm
^Just a normal text editor.

dochall22
Tue 12th Feb '08, 1:38pm
i used microsoft word to finally get it to open - it was trying to use IE - i still cant get it to work though, I dunno wtf is going on but i'm gettin FRUSTRATED

dochall22
Tue 12th Feb '08, 1:41pm
i'm using godaddy.com as my host

here's what they sent me as my info for uploading


. Your FTP user name (sXXXXXXXXX) and password

2. FTP address or host name: sXXXXXXXXXXXX.com (http://spiderwickchat.com/)

3. Start Directory: Some FTP clients will ask for a "Home"
or "Start" directory. Our hosting service does not require
this, so simply leave the box blank or enter a single forward
slash (i.e., " / ")

4. FTP Port: You should enter "standard" OR "21."

I have the upload stuff in a folder called forum, but i'm not sure if i'm typing the rigth stuff in the right spots on this config file??!!??

zappsan
Tue 12th Feb '08, 1:48pm
You don't have to put in your FTP info in the config.php, you need your MySQL database and user name and password.

And for opening, click "Open with" and select some editor.

dochall22
Tue 12th Feb '08, 1:51pm
so is the database the folder in which i uploaded everything to or is it the address to my website?

so all i have to change is the database - username - and password? seems to simple

what about the port number? mine says 21 instead of the 3306

zappsan
Tue 12th Feb '08, 2:14pm
The database isn't a folder, it's the place where all the data is placed in, all the posts, threads, users etc.

You upload the files to your host through an FTP program (and use the FTP info you received to login).
Then you need tp create a database. Usually most hosts have a srot of control panle or phpMyadmin where you can create databases.

dochall22
Tue 12th Feb '08, 2:30pm
ok i have a database made - when i type in the database location - is it

database name = database

website name = website.com

database.website.com
or
database

or???

dochall22
Tue 12th Feb '08, 2:33pm
i put in just the database name, changed the mysql to the right one and now for the host name or ip - do i type in the ip number that shows up for the database?

zappsan
Tue 12th Feb '08, 2:36pm
No, just leave it default.
All you've got to do is to fill in the database name (in the "$config['Database']['dbname'] =" option)-

dochall22
Tue 12th Feb '08, 2:44pm
i tried that too, didnt work - i dunno what i'm doing wrong, but something aint right on my side. thanks for the help though - i'm going to keep tryin

dochall22
Tue 12th Feb '08, 2:57pm
$config['Database']['dbname'] = 'forum';


where do i change the info? do i change dbname or do i change forum?

if my dbname is CHAT for example which of the following is right

1 $config['Database']['CHAT] = 'forum';
2 $config['Database']['dbname'] = 'CHAT';


which is the right one? 1 or 2?

Steve Machol
Tue 12th Feb '08, 3:04pm
#2.

dochall22
Tue 12th Feb '08, 3:08pm
#2.


awesome - well i did it that way this time but now i'm getting a new error


if i'm on godaddy.com with my database - and the database is named FORUM for example - is that all i put in for the database name?

dochall22
Tue 12th Feb '08, 3:09pm
Warning: fetch_config(/home/content/s/p/i/spiderwick/html/forum/includes/config.php): failed to open stream: No such file or directory in /home/content/s/p/i/spiderwick/html/forum/includes/class_core.php on line 2386

Warning: fetch_config(/home/content/s/p/i/spiderwick/html/forum/includes/config.php): failed to open stream: No such file or directory in /home/content/s/p/i/spiderwick/html/forum/includes/class_core.php on line 2386

Warning: fetch_config(): Failed opening '/home/content/s/p/i/spiderwick/html/forum/includes/config.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/p/i/spiderwick/html/forum/includes/class_core.php on line 2386


Configuration: includes/config.php does not exist. Please fill out the data in config.php.new and rename it to config.php

Steve Machol
Tue 12th Feb '08, 3:16pm
This means you are either using the wrong URL or there is no config.php file in that directory.