php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26226 Suddenly unable to reach the MySQL database
Submitted: 2003-11-12 15:25 UTC Modified: 2003-11-12 16:32 UTC
From: robin dot fredman at armagedon dot org Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.3.4 OS: Win98
Private report: No CVE-ID: None
 [2003-11-12 15:25 UTC] robin dot fredman at armagedon dot org
Description:
------------
I have an Apache webserver up and running, using PHP to communicate with a MySQL database. The database pretty much handles everything on the page, so if php can't connect too it, nothing will load.

Reproduce code:
---------------
dbconnect.php:

<?php
$connection = mysql_connect ("localhost", "<username>", "<password>") or die ( "Could not connect to localhost" );
$database = mysql_select_db ("data_base", $connection);
?>

Expected result:
----------------
I expect to see the whole page load, i.e. that it can connect to the Database and then proceed to load the rest of the page.

Actual result:
--------------
Instead, I get a white screen with the following text:

Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10055) in E:\Program\Apache Group\Apache2\htdocs\functions\dbconnect.php on line 2
Could not connect to localhost

I'm not sure wether it is a MySQL error, or if it's PHP. However, mysqladmin version shows that there is no problems. I am also running mysqld --log-error, and the log shows nothing faulty. It seems as if php is unable to access port 3306 or something. When reloaded several times, the page sometime loads "half-way", i.e. text and some colours, but usually no pictures. When reloaded a few more times, it's just the result above again.



Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-12 15:28 UTC] robin dot fredman at armagedon dot org
Apache version is 20.48 for Win32 (Win98)
MySQL version is 4.0.16.
I am also running DigiChat version 4.0 (It's javabased) in the server, don't think it has anything to do with it though.
 [2003-11-12 16:32 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

There is nothing about the error to suggest that this a PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 03:01:29 2024 UTC