|
Posted by steve on 04/15/07 22:24
On Sat, 17 Feb 2007 01:55:11 +0800, Tom wrote
(in article <er4r5v02pnn@drn.newsguy.com>):
> On 16 Feb 2007 07:17:13 -0800, kenoli wrote...
>>
>> On Feb 15, 2:44 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>>
>>> ERROR 2002 (HY000): Can't connect to local MySQL server through
>>> socket '/tmp/mysql.sock' (2)
>>>
>>> I will read up a little more I guess. One day I might actually
>>> get some progress.
>>>
>>> --
>>> dorayme
>>
>> Check out this site:
>>
>> http://www.entropy.ch/software/MacOSx/mysql/
>>
>> especially the forums. I remember some issue about the way the tmp/
>> directory is used. It is a directory that is used by a number of
>> applications for temporary files and there are issues related to
>> linking to it and automatically deleting files. I wish I understood
>> this adequately to explain it myself, but I think you will find some
>> info on this site to help you. I had some trouble at first getting
>> things working and since then it has all been so stable that I forgot
>> the original issues.
>>
>> Liyanage's site was at least once the gold standard for installing
>> mysql on a Mac.
>>
>> --Kenoli
>>
>
> Maybe the permission settings on /tmp are too strict and MySQL can't access
> the
> directory to write in it?
>
> Tom
>
no apple fucked up the setup.......
here are my notes to get a working php+ my sql
How to fix Warning: mysql_connect(): Can't connect to local MySQL server
through socket '/var/mysql/mysql.sock'
Apparently, OS X Tiger doesn't allow for PHP MySQL connection out of the box.
You get this:
Warning: mysql_connect(): Can't connect to local MySQL server through socket
'/var/mysql/mysql.sock'
I found the most clear fix here:
/etc/php.ini(.default) looks for mysql.sock in the wrong place... two options
are to make a symbolic link from the right place to the socket...
sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
Or you can update your /private/etc/php.ini (.default) by finding
"mysql.default_socket" and setting it to equal /private/tmp/mysql.sock and
then restart apache with "apachectl graceful"
/etc/httpd/httpd.conf
> <form action="test.php" method="post">
.../..
> I get the following:
>
> Method Not Allowed
> The requested method POST is not allowed for the URL
You might want to actually "activate" your php module (it's not loaded
by default on Mac OS X).
To do so, become root then edit /etc/httpd/httpd.conf and search for:
#LoadModule php4_module libexec/httpd/libphp4.so
change it to:
LoadModule php4_module libexec/httpd/libphp4.so
search for:
#AddModule mod_php4.c
change it to:
AddModule mod_php4.c
save, and restart apache.
patpro
--
http://www.patpro.net/
RECOVER ROOT PASSWORD
server as root without requiring password or by keying in blank password.
However, if you have set the password for root and forget or unable to recall
the password, then you will need to reset the root password for MySQL.
Login as root to the Unix-like (Unix, Linux or BSD) machine with the MySQL
server.
Stop the MySQL server by using either of the following command
#/etc/init.d/mysql stop
Now you need to Start MySQL server without password
# mysqld_safe --skip-grant-tables &
Connect to mysql server using mysql client with the following command
# mysql -u root
Now you should be having mysql prompt
mysql>
Now you need to Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD(²newrootpassword²) where
user=¹root¹;
mysql> flush privileges;
mysql> quit
Note: Replace newrootpassword with the new root password for MySQL server.
Flush Privileges is needed to making the password change effect immediately.
Now you need to Stop MySQL Server using the following command
# /etc/init.d/mysql stop
Test Your New Mysql root password
First you need to start mysql server using the following command
# /etc/init.d/mysql start
# mysql -u root -p
Now it will prompt for root password and enter your new root password
also
/etc/php.ini
must have:
register_globals = On
[Back to original message]
|