Author Topic: DB Error: Could not connect to the database server  (Read 7674 times)

0 Members and 1 Guest are viewing this topic.

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
DB Error: Could not connect to the database server
« on: February 03, 2006, 04:57:22 AM »
You've probably seen this question a thousand times yet I'm stuck.   I must be doing something wrong.  I can't get past the first screen and don't understand why.

Here is how I'm filling out the info...

Database server type: mysql
Database server hostname:  I'm entering the full domain name of my site.  I've tried both with and without the "www" and the "http://"
Database name:  Pretty easy.  I'm putting in the exact name of the new mysql database I just created.
Database username:  As per my host's instructions, this is just my domain name without the "www" and without the "dot com".  Same username for logging into my MySql control panel which is working.
Database password:  Password is the one I chose when I created me new mysql database.
Prefix for tables in database   default setting... "4images_"

Admin username:  I can only assume this is the master username for my entire web site hosting account.  Is this true?
Admin password:  Again I assume that this is the password for my hosting account.

I'm paying attention to the case of the letters and tried this about a dozen times... nothing works.

Anything else I can try??

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Could not connect to the database server
« Reply #1 on: February 03, 2006, 05:18:10 AM »
Anything else I can try??
Ask you hoster about that information, nobody else can help you on this one.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: DB Error: Could not connect to the database server
« Reply #2 on: February 03, 2006, 05:44:49 AM »
Anything else I can try??
Ask you hoster about that information, nobody else can help you on this one.

What more to ask them?  All that username and password information is correct.

What I'd like to know from the experts here is did I enter these things in the correct format.

What about this?  Do I just enter my web site domain name?  Does it matter if I use the http or not?  Do I need a trailing slash at the end?

Quote
Database server hostname:  I'm entering the full domain name of my site.  I've tried both with and without the "www" and the "http://"

And this?  Is this the Admin login info for the hosting account or for the MySql database?

Quote
Admin username:  I can only assume this is the master username for my entire web site hosting account.  Is this true?
Admin password:  Again I assume that this is the password for my hosting account.

Also, is there any other server setting that can cause this first step to fail?  I'm sorry to be a pest but I can't see what's going wrong here and I already have confirmation from the host that the usernames and passwords are correct.  They can not provide any further help.

Thank-you very much.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Could not connect to the database server
« Reply #3 on: February 03, 2006, 06:00:19 AM »
Do I just enter my web site domain name?  Does it matter if I use the http or not?  Do I need a trailing slash at the end?
That is the information you need to ask you host administrator!
No, trailing slash needed, but the address to your mysql server is nobody but your host administrator could possibly give.
You need to know the following:
1) address to mysql server
2) database name (you might need to create one yourself, but again, the host's administrator should help you)
3) username and password for the database

As of admin user/pass at the last section - its your choice, that is the administrator account you create to manage you gallery.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: DB Error: Could not connect to the database server
« Reply #4 on: February 03, 2006, 06:07:42 AM »
Do I just enter my web site domain name?  Does it matter if I use the http or not?  Do I need a trailing slash at the end?
That is the information you need to ask you host administrator!
No, trailing slash needed, but the address to your mysql server is nobody but your host administrator could possibly give.
You need to know the following:
1) address to mysql server
2) database name (you might need to create one yourself, but again, the host's administrator should help you)
3) username and password for the database

As of admin user/pass at the last section - its your choice, that is the administrator account you create to manage you gallery.

You've been quite helpful on clearing up the admin username/password info.

As far as the database stuff, my guess is that the database hostname must be something other than my domain name.  The database name, login, and password I know are correct as I just created them.

Thank-you.

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: DB Error: Could not connect to the database server
« Reply #5 on: February 03, 2006, 06:12:09 AM »
From my host's web site...

Quote
Accessing MySQL with PHP
Use the following outline to connect and begin querying the mySQL server from within your PHP scripts. Remember that you cannot connect to your databases remotely due to security reasons. You can only connect to them from localhost.
Connect to the mySQL Server: Use the following statement to connect to the database server. Substitute the username, and password for ones you have created in the WebControl System.

MYSQL_CONNECT('localhost','USERNAME','PASSWORD');


Select Your Database: Use the following statement to select the database you wish to connect to. Make sure you substitute the example with your database name.

@mysql_select_db("DATABASENAME");


Executing A Query: You are now ready to execute your queries. (Most problems that arise with your scripts will be due to incorrect permission settings.)

After reading that I'm now wondering if I can even use your script with my host.  I'll have to contact them in the morning to ask.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Could not connect to the database server
« Reply #6 on: February 03, 2006, 06:22:44 AM »
use localhost for the address

P.S. your host's FAQ is seems to be for people who already know PHP...omg...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: DB Error: Could not connect to the database server
« Reply #7 on: February 03, 2006, 06:30:52 AM »
use localhost for the address

P.S. your host's FAQ is seems to be for people who already know PHP...omg...

THANK-YOU.  I just figured that out myself a minute ago.  Can I say, "great minds think alike"?  Maybe not :P

I actually tried "localhost" not really thinking it would work.  But it did!

Offline sparky

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: DB Error: Could not connect to the database server
« Reply #8 on: February 03, 2006, 06:35:38 AM »
Your program seems really easy to setup and use.  I tried "Gallery" last year but got some really strange errors on certain computers/browsers.  Actually got the error on some computers running MY installation and no errors viewing others' installations.  Very confusing problem and never got it resolved.

THANK-YOU.