473,547 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP-Mysql Socket Problem

Hello frends!

I want to connect with mysql using php.

In my mysql "my.cnf" file i have specified the socket for both client
and server as
"/usr/local/mysql/var/mysql.sock"

In my "php.ini" file, for mysql socket i have specified

/usr/local/mysql/var/mysql.sock as the default path.

But i can't able connect with database. it shows DB connection failed.
My phpinfo() gives the following two lines for mysql sock

MYSQL_SOCKET /tmp/mysql.sock
mysql.default_s ocket /usr/local/mysql/var/mysql.sock /usr/local/mysql/var/mysql.sock
If i set the socket as /tmp/mysql.sock in "my.cnf" , I CAN ABLE TO
CONNECT.

What is the difference between MYSQL_SOCKET and mysql.default_s ocket ?

Advanced thanks
Bala

Jul 7 '06 #1
2 2685
On 7 Jul 2006 10:16:20 -0700, "balavignes h" <kb**********@g mail.comwrote:
I want to connect with mysql using php.

In my mysql "my.cnf" file i have specified the socket for both client
and server as
"/usr/local/mysql/var/mysql.sock"

In my "php.ini" file, for mysql socket i have specified

/usr/local/mysql/var/mysql.sock as the default path.

But i can't able connect with database. it shows DB connection failed.
My phpinfo() gives the following two lines for mysql sock

MYSQL_SOCKET /tmp/mysql.sock
mysql.default_ socket /usr/local/mysql/var/mysql.sock /usr/local/mysql/var/mysql.sock
If i set the socket as /tmp/mysql.sock in "my.cnf" , I CAN ABLE TO
CONNECT.

What is the difference between MYSQL_SOCKET and mysql.default_s ocket ?
MYSQL_SOCKET shown on phpinfo() appears to be the value specified in
"configure" via --with-mysql-sock.

It gets mapped onto the constant MYSQL_UNIX_ADDR , which is used in the mysql
module's phpinfo function.

But after looking through the rest of the source of the mysql module (in
5.1.4) it doesn't appear to be used anywhere else - only the configuration
option mysql.default_s ocket seems to be accessed, so it's that one you've got
to set.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 7 '06 #2

Andy Hassall wrote:
But after looking through the rest of the source of the mysql module (in
5.1.4) it doesn't appear to be used anywhere else - only the configuration
option mysql.default_s ocket seems to be accessed, so it's that one you've got
to set.
Thanks for ur clarification Andy...but,

If i set the default socket as "/usr/local/mysql/var/mysql.sock"
in php.ini
and
/etc/my.cnf ,

i can't able to connect.

it only works if i set /tmp/mysql.sock in both place.

what is the reason?

regards
Bala

Jul 10 '06 #3

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

Similar topics

3
4033
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
60
10011
by: English Teacher | last post by:
Which would be more useful to learn, PHP or COLDFUSION? I know Coldfusion is popular in the work force. Is PHP? Thanks!
43
4790
by: grz02 | last post by:
Hi, Im an experienced database+software designer and developer, but, unfortunately, anything to do with web-programming and web-systems designs is still a pretty new area to me... (been working mostly with "legacy" environments the last 10 years) So I am writing this, hoping to get some useful advise and feedback... I have done some...
59
6948
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta http-equiv="Content-Type" content="text/html;
8
4022
by: Marcel | last post by:
I have a problem with a PHP page that seems to get executed twice. I am running PHP5 ISAPI on 2003 server. The script is a PHP page with a form. When the form is submitted one record have to be inserted in the database but when i look at the database after submitting the form there are two(!) records inserted so it looks like the script...
1
2631
by: ansc1 | last post by:
Hello, I'm new to using php coding. I need help with the following: 1. There is a submit button on the form and is saves information to my database. After clicking on "Save Measurement" it redirects me to another page in my site. What I would like to do is change what page directs it to. Currently the submit button redirects me to page...
0
2738
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ext/xmlrpc/.libs/xmlrpc-epi-php.o(.text+0x359): In function `set_zval_xmlrpc_type': /php-5.2.5/ext/xmlrpc/xmlrpc-epi-php.c:1313: undefined reference to...
0
1337
by: Patriot89 | last post by:
I have a quick question in reference to php file extenstions... I have code for example like this... This is all located on this site www.ixalliance.com/BHS/Default (This is my nav.php file) <div class="navstyle" id="navmenu"> <ul> <li><a href="index.php">Home</a></li> <li><a href="administration/admin.php"...
5
4614
Chrisjc
by: Chrisjc | last post by:
Good afternoon, I am seeking some php configuration help. Here is the run down I am running Windows server 2003 and IIS V6.0 I have never had issues before until now. I have Symantec Antivirus 11.0 Manager, it controls all the Symantec clients in the company. Now it uses a web interface for all of its commands and settings which is called...
1
7265
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category and Brand I need to make some changes on a a number of brands in a Category
0
7435
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7794
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.