473,390 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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 1886
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

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

Similar topics

3
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as...
6
by: Jeff Sandler | last post by:
I have a database I created in mySQL. I've been entering data every day into the database using a Java application that I wrote. The database and the Java program are on the same Win 98 SE...
2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
0
by: CAIBird | last post by:
hi, i've been developing a webservice on machine A and one WebMethod of this webservice will connect to SQL Server2000 on machine B using a connect string defined in Web.config as below: <add...
4
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop (Windows xp prof. ed.). But when I try to connect to any of my local databases I get this error: SQL30082N Security processing failed with...
6
by: antonyliu2002 | last post by:
I was able to view table content easily before, but after I reinstalled everything, I cannot find the option to view table content in MS SQL Server Express. I can define table with no problem. ...
10
by: priyakollu | last post by:
hi guyz! please help me in sorting out error as im unable to find it... my requirement is there will be userid field and password field and "login" button after clicking button certain validations...
0
by: =?Utf-8?B?UGFua2Fq?= | last post by:
Please go to http://www.a2zdotnet.com/Default.aspx for step by step tutorials for beginers in ADO.Net sections. -- regards, Pankaj http://www.A2ZDotNet.com "George" wrote:
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.