468,761 Members | 1,799 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,761 developers. It's quick & easy.

Keep Getting the 'Cannot connect to database'

4
I'm fairly new to the whole MySQL thing, But not new to SQL. So doing most of this was fairly easy, but I have a hosting service with Godaddy.com, and Yes it supports MySQL 5.0 and is installed and working. I'm trying to setup a basic news script for a upcoming website I have and I just wanted to dink around with it before I have everything up and going - But I seem to have a problem I keep coming across. Either my Screen will NOT show anything or will show Cannot connect to database. Now I have the database name correct, Everything should be correct.


<?php
$dbhost='host';
$dbusername='username';
$dbuserpass='pass';
$dbname = 'cossmoss';
?>

I left the db name. But I'm not 100% sure on how the dbhost is suppose to be setup, Since it is a remote connection. Any light to shed on this would be greatly appericate I've been stumped for the past 4 hours lol.

I've trying some of the following dbhost setups

ipipip.hostname
hostname.com:80 (80 being the port I think lol)
ipipipip
databasename:80
Jan 16 '08 #1
4 1572
stepterr
157 100+
I'm fairly new to the whole MySQL thing, But not new to SQL. So doing most of this was fairly easy, but I have a hosting service with Godaddy.com, and Yes it supports MySQL 5.0 and is installed and working. I'm trying to setup a basic news script for a upcoming website I have and I just wanted to dink around with it before I have everything up and going - But I seem to have a problem I keep coming across. Either my Screen will NOT show anything or will show Cannot connect to database. Now I have the database name correct, Everything should be correct.


<?php
$dbhost='host';
$dbusername='username';
$dbuserpass='pass';
$dbname = 'cossmoss';
?>

I left the db name. But I'm not 100% sure on how the dbhost is suppose to be setup, Since it is a remote connection. Any light to shed on this would be greatly appericate I've been stumped for the past 4 hours lol.

I've trying some of the following dbhost setups

ipipip.hostname
hostname.com:80 (80 being the port I think lol)
ipipipip
databasename:80
I also use a hosting service, not GoDaddy though, so it may be different. But on mine I can just put the following.

[PHP]$dbhost = "localhost";[/PHP]

I'd give that a try if I were you. Good luck!
Jan 16 '08 #2
Gourk
4
Well appericate the helping hand, but alas it still does not work.


BUT I think I have found the problem, when setting up the php/mysql I didn't check install DSN LOL
Jan 16 '08 #3
Gourk
4
Hrm nvm, That is not even needed. I'm still having the same problem. It's like my hosting isn't even able to support php, I'm constantly seeing a White Screen. I even copied EXCALTY the information (username/databasename.. etc) from the godaddy information they gave me to the connect.php file =x
Jan 17 '08 #4
Gourk
4
FINALLY. Thanks for even posting m8, I finally got it to work.. I just had to read up on some documention on godaddy.com on their service, Come to find out it was on a linux server.. I was posting windows commands on it lol :P
Jan 17 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by CAIBird | last post: by
4 posts views Thread by Odd Bjørn Andersen | last post: by
reply views Thread by =?Utf-8?B?UGFua2Fq?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.