473,394 Members | 1,717 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,394 software developers and data experts.

A link to the server could not be established in...


Folks,

I'm writing an application on a LAMPhp server... Everything has been fine up
until now though I have only got about 6months of MySQL behind me.

Today... my server has started to report the following while trying to do a
mysql_query() select from an empty table...

Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in
/data/www/websites/mydomain.com/www/include2/standard/MySQL.fip on line 139

Warning: mysql_query(): A link to the server could not be established in
/data/www/websites/mydomain.com/www/include2/standard/MySQL.fip on line 139
Two things though:
1) I have output the query to the browser, then cut and pasted it in to the
mysql command line and it executes, returning no errors, and zero rows.
2) I can connect both from the server, and my client machines to MySQL...

So where could my problem be? I'm the only user on the box...

anybody got any ideas? My code at line 139 works fine as the same group of
functions work in my other coded projects so I know it can't be that...

Thanks in advance,
randell d.
Jul 19 '05 #1
9 22644
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.
Jul 19 '05 #2
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.
Jul 19 '05 #3
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.
Jul 19 '05 #4

"Aggro" <sp**********@yahoo.com> wrote in message
news:%A*************@read3.inet.fi...
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.


The file doesn't exist - I don't know if that is a good thing or not -
However I put a mysql connect before my insert and things worked fine...

I think it was because I had no persistent connections open to the db - And
I've not had this before - But... thinking further... I did reboot the box
earlier and its possible this had everything to do with no pre-existing
connections... I'll have to remember that in future...

Thanks though for the post...

randelld
Jul 19 '05 #5

"Aggro" <sp**********@yahoo.com> wrote in message
news:%A*************@read3.inet.fi...
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.


The file doesn't exist - I don't know if that is a good thing or not -
However I put a mysql connect before my insert and things worked fine...

I think it was because I had no persistent connections open to the db - And
I've not had this before - But... thinking further... I did reboot the box
earlier and its possible this had everything to do with no pre-existing
connections... I'll have to remember that in future...

Thanks though for the post...

randelld
Jul 19 '05 #6
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in
/data/www/websites/mydomain.com/www/include2/standard/MySQL.fip on line 139


Come to think of it.. some people have had problems, because operating
system clears tmp/ folder automaticly. You might be safer to sertup the
file to be somewhere else.
Jul 19 '05 #7

"Aggro" <sp**********@yahoo.com> wrote in message
news:%A*************@read3.inet.fi...
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in


Well, is there a file /tmp/mysql.sock in the server? Looks like php is
assigned to use socket file in there, but I bulieve MySQL uses socket
file in another place. Don't remember how it was checked, but try to
find out what socket file MySQL uses and compare it to the one php uses.
If they don't match, either php or MySQL needs to be reconfigured.


The file doesn't exist - I don't know if that is a good thing or not -
However I put a mysql connect before my insert and things worked fine...

I think it was because I had no persistent connections open to the db - And
I've not had this before - But... thinking further... I did reboot the box
earlier and its possible this had everything to do with no pre-existing
connections... I'll have to remember that in future...

Thanks though for the post...

randelld
Jul 19 '05 #8
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in
/data/www/websites/mydomain.com/www/include2/standard/MySQL.fip on line 139


Come to think of it.. some people have had problems, because operating
system clears tmp/ folder automaticly. You might be safer to sertup the
file to be somewhere else.
Jul 19 '05 #9
Reply-Via-Newsgroup wrote:
Warning: mysql_query(): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in
/data/www/websites/mydomain.com/www/include2/standard/MySQL.fip on line 139


Come to think of it.. some people have had problems, because operating
system clears tmp/ folder automaticly. You might be safer to sertup the
file to be somewhere else.
Jul 19 '05 #10

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

Similar topics

0
by: MrPhil | last post by:
(SQL 2K SP3a on W2K. VFP 6 data lives on W2K. GIGABIT BACKBONE, gig cards on the data servers) I'm sure anyone who attempts to retrieve or alter FP/VFP data through a SQL link server will...
0
by: RiteshDotNet | last post by:
I have two server 1. AServer -> Windows 2003 server 2. BServer -> Windows 2000 server Both are having SQL server 2000 with sp3 I have created Link Server on BServer which is link with...
4
by: paul dallaire | last post by:
HI! I want to execute a link witch is in JavaScript, How do we execute this in asp server side if possible? Basically I don't want anyone to see this link in the code view. this is the link...
2
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have...
4
by: Nasir | last post by:
I've a database in 2000 which needs to be accessed from 2005 via linked server. I've tried the GUI options and it is failing. One thins is that our both servers have hyphen('-' not underscore,...
2
by: SQL Server Questions | last post by:
Environment: Server1 (Local) OS Windows 2000 Server SQL Server 2000 Server2 (Remote) OS Windows 2003 Server SQL Server 2000 (Both with most recent service packs)
1
by: Vincent | last post by:
Is it possible to create a link server in SQL Server without using the default system.mdw file? Any help is appreciated. Thanks.
4
by: perryche | last post by:
Is this possible? Instead of using the link wizard, can the FE/BE link be established any other way that users can simply type the link path? Thanks, Perry
0
by: Derftics | last post by:
Hello everybody, Did anyone of you know this problem? Goal: I need to created a SQL 2005 link server using the radio button "I]Be made using login's current security context" Scenario 1: I...
0
by: arial | last post by:
Hi all, I am getting following error message when I tried to add a user in my list. The way I have it designed it, I have sql database which connects to another sql database using a link server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.