|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I have install the above on my pc
mysql works fine on mysql>prompt and php runs fine with apahce as DSO module. However, when I have the following code in test.phtml : mysql_connect("localhost","webuser",""); I have the following response: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/httpd/html/test.phtml on line 5 I cannot understand why. Since it is urgent to establish the combination, would any one pls give me a way to solve or a good way to install all above so that everything goes fine? Further, I have checked the mysql.sock belongs mysql user and group. When I change to root, there is no change . Thanks in advance ------------------ ST WONG |
|
#2
|
|||
|
|||
|
My guess is that your default mysqld socket is either not 3306 or your connect needs to include the port number. Since you can connect via >mysql, your mysqld port is probably set to 3306, so it's probably your client port setting which isn't working. Maybe try this: "localhost:3306".
You can find out mysqld's port by using: mysqladmin variables a guess... -TM |
|
#3
|
|||
|
|||
|
I have come across this as well. I'm not quite sure why but I fix it by using the actual hostname instead of localhost. Sounds odd but works. If anyone knows why I'd be interested in some insight as well.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by stwong: I have install the above on my pc mysql works fine on mysql>prompt and php runs fine with apahce as DSO module. However, when I have the following code in test.phtml : mysql_connect("localhost","webuser",""); I have the following response: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/httpd/html/test.phtml on line 5 I cannot understand why. Since it is urgent to establish the combination, would any one pls give me a way to solve or a good way to install all above so that everything goes fine? Further, I have checked the mysql.sock belongs mysql user and group. When I change to root, there is no change . Thanks in advance [/quote] |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > MySQL, PHP APACHE RedHat Linux6.1 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|