php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7856 PHP can't conect to mysql server
Submitted: 2000-11-16 21:17 UTC Modified: 2000-11-22 08:11 UTC
From: javierdeco at hotmail dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.3pl1 OS: Redhad 7.0
Private report: No CVE-ID: None
 [2000-11-16 21:17 UTC] javierdeco at hotmail dot com
I got this message trying to connect to mysql database from my php page.
-----------------------------------
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock:' (111) in
/var/www/html/table.php on line 17
--------------------------------
The line 17 is:

mysql_connect('localhost:3306:/var/lib/mysql/mysql.sock:','root','decomysql');

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-18 22:43 UTC] sniper@php.net
1. Does simple mysql_connect("localhost", "user", "password") work?
2. Are you sure you have mysqld up and running?
3. Can you connect to mysql using the mysql shell utility from command line?

--Jani
 [2000-11-22 08:11 UTC] sniper@php.net
User feedback:
-----------
>1. Does simple mysql_connect("localhost", "user", "password") work?
No, it doesn't work.

>2. Are you sure you have mysqld up and running?
Yes, I am

>3. Can you connect to mysql using the mysql shell utility from command 
>line?

No, I can't.
I can connect only when log on as root.
When I log on with my user I can't connect and get the same error.

Could you please give any idea to resolve it?

----

Obviously you haven't configured mysql correctly. 
Please refer to http://www.mysql.com/ for further information
on how to configure mysql. Or ask on php-db@lists.php.net
This bug system is meant for reporting possible bugs in PHP.
This is not a bug.

--Jani

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 08:00:02 2026 UTC