|
|
#1 |
|
Prospect
Join Date: May 2006
Posts: 4
|
I have installed MAC OS X and installed pre-packed MySQL.
Then I have installed entropy PHP Version 4.3.11 But I am unable to make connections using PHP and MYSQL. Althouh, I can login to mysql using terminal window and can create and drop databases, but PHP doe snot connect. I saw this article http://www.macosxhints.com/article.p...uery=php+mysql and then I changed my php.ini so that mysql.default_socket = /var/mysql/mysql.sock and it reflects in phpinfo also. I also made the owner of /var/mysql to mysql and also set up the permissions of /var/mysql to 755 but still I am just unable to make connection. Any help or pointers will be appreciated. Thanks, Tripat |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Nov 2002
Location: Massachusetts
Posts: 202
|
What version of MySQL are you running, and whose package did you install?
Are you using the installed PHP that came with your OS X, or are you using a version that you compiled from source code or installed from a package? Third, are you trying to access the scripts through the web browser or are you trying to run them from the command line? Knowing these things will help us determine what may be going wrong. Sadly, as convenient as the precompiled packages are, there are often variations that keep them from working as easily as one would like, depending on how they are going to be used.
__________________
There is no such thing as a stupid question. If you don't ask, you will never know. |
|
|
|
|
|
#3 |
|
Prospect
Join Date: May 2006
Posts: 4
|
I am using MySQL Version 4.1.13a that is installed during OSX installation. It came pre-packed with the OSX.
I have installed entropy PHP packagaed, that I have downloaded and installed. I am trying to run the PHP scripts from web browser. Thanks for replying. |
|
|
|
|
|
#4 |
|
Prospect
Join Date: May 2006
Posts: 4
|
I have tried on command line and it works well from command line to give output in terminal screen.
But when I try using the webbrowser, it does not work and gives me connection not made error. I using the following php code: <?php $linkid = mysql_connect("localhost","root","tripat") or die ("No connection"); echo $linkid; exit; ?> On command propmpt when I run : php tripat.php, it gives me "Resource id #4" but when I run on webbrowser, I get the error "No Connection". |
|
|
|
|
|
#5 |
|
MVP
Join Date: Dec 2002
Location: NYC
Posts: 1,005
|
Try changing die ("No connection") to die (mysql_error()) and show us the error.
This will tell you what the error is rather than just "No Connection". |
|
|
|
|
|
#6 |
|
Prospect
Join Date: May 2006
Posts: 4
|
I tried using the die(mysql_error()) and I get the following error:
Client does not support authentication protocol requested by server; consider upgrading MySQL client |
|
|
|
|
|
#7 | |||||||||||||||||||
|
Triple-A Player
Join Date: Nov 2002
Location: Massachusetts
Posts: 202
|
Is the MySQL daemon running?
Most of the time, this error means mysqld isn't running. At the command line as "root", start mysql with this command: mysqld_safe --user=mysql & Upon a successful start, you should see this message: Code:
Starting mysqld daemon with databases from.... If you see the message below, then mysqld is already running and you have a different problem (which means we eliminated one possibility): Code:
A mysqld process already exists
__________________
There is no such thing as a stupid question. If you don't ask, you will never know. |
|||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|