473,507 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql connect failure

I have 2 scripts that both start with:
<?php
// Database Connection
include 'connect.php';

One of them is fine, but the other gives the error:

Warning: mysql_connect(): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (111)

Since the same file is being included both times, I can't see why it should
fail in one case.

Any ideas anyone?

TIA
Regards
Paul
May 3 '06 #1
1 1458
"Paul Lautman" <pa**********@btinternet.com> wrote:
I have 2 scripts that both start with:
<?php
// Database Connection
include 'connect.php';

One of them is fine, but the other gives the error:

Warning: mysql_connect(): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (111)

Since the same file is being included both times, I can't see why it should
fail in one case.

Any ideas anyone?


Two different scripts on one machine, or one script on two different
machines? If it is the latter, then one machine isn't running MySQL
locally.

If the former, are these both running as CGI or within Apache?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4231
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
0
1213
by: jwl | last post by:
I'm having a problem with a bit of code that I have "adopted". It was partially complete when I took it over. The function of the code is to read a log file, locate files described in that log...
0
1727
by: Atif | last post by:
Hi All My problem is not related with this group BUT i have got a clue from here that's why i am posting this question over here. I am using Crystal Reports 9 with MySQL and SQL Server....
5
3831
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same...
7
2478
by: Ike | last post by:
Let's say I have a MySQL 4.12 database, opened to the internet on 111.111.111.111 allowing all incoming and outgoing ports. I have a username and password setup, which CAN connect to this database,...
14
6070
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
18
2223
by: Bruce A. Julseth | last post by:
I have the following code $Host = "localhost"; $User = "Fred"; $Database = "house"; $Password = "mypw" echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" . $Database;
3
1801
by: drblitzkrieg | last post by:
Hi, A bit of a newbie as far as mysql and php adminning I am; I upgraded php to version 4.4.6, and mysql to 4.1.22, following the instructions in the "INSTALL" files of each (I also have the...
1
1896
by: vincedav31 | last post by:
I have a connection to a server and my database. I use it like this in my code : Class.forName("com.mysql.jdbc.Driver"); String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3"; m_connection =...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7111
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
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.