I have done reading and searching on this very issue:

The MySQL error was: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2).

....and I know generally what I need to do to fix my problem, but I am not versed enough to know how to do the things people had talked about in the posts I have read.

I am running OSX 10.4.8
PHP 5
MySQL 5.xx

I have attempted to install Drupal 4.6 locally before, and was successful, but then I broke it and never really fixed it. This time I just replaced the files wth Drupal 5.0 and reinstalled MAMP which seemed to fix some issues I was seeing with MySQL, and I set up the new dbase and attempted to connect to it with the new installer and thats as far as I've gotten this time around.

**My understading thus far is that Apple made a security change somewhere in PHP or MySQL so that PHP doesn't know where to look for MySQL, or vice a versa? and that I have to manulally fix some lines of code in the config files, either fixing MySQL or PHP, one being more secure than the other.
***Here is my problem, I don't know enough to know where these files are, how to create new ones and where to put them. Again I am using MAMP, and the only place I can find some of the config files is in that folder, such as the php.ini file that I supposedly have to do something to this line

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = /tmp/mysql.sock

I am wondering if first I should re-install MySQL, or everything and just start fresh, becuase after hours of messing around with config files, I have no doubt botched them all, and I can't remember exactly what I have done. and also, can anyone explain, including how to look for and find some of the files, ex 'my.config', and what steps to take to get drupal up and running when one gets this error. I have been using text wrangler to find some of those files, but then it makes it hard to see where it came from, for me.
Thanks

Comments

tandonian’s picture

Ok, coming back to it after a week, I no longer get the error

Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = /tmp/mysql.sock

I now get this message
The MySQL error was: Access denied for user 'Nexusadmin'@'localhost' (using password: YES).

I am using MAMP, and I don't realy know what to do

vm’s picture

double check your database username and password.

tandonian’s picture

I checked the database that I created, and even recreated it.

vm’s picture

so you can login to your database manually ? with say phpmyadmin ?

does your database user have the necessary permissions as outlined in the INSTALL.mysql.txt file included in the drupal download ?

tandonian’s picture

I am using PHPmyAdmin. I followed a Lullabot video about installing drupal 5. so I didn't read the .text file. I created a local database 'x' and then a user that had permission only for that database.

My Settings.php file seems fine, I changed mysql login line with all the right info.

vm’s picture

The video is not a replacement for the install.txt files and the readme.txt , the video assumes you have read this information before proceeding.

it is important with Drupal that you have all the proper permissions on the database user:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES

insure that you have these database permissions on the user you are accessing the database with.

tandonian’s picture

When I created the database user, I checked the 'select all' permissions checkbox, and it is only for that the database that I created on localhost. I wil read up in the files though, thanks

tandonian’s picture

I have chceked that all the database settings are OK and priviledges are set properly. Still the same error.

Could it have something to do with the port configuration? I noticed on the lullabot video that they were running PHPmyadmin from the local host, and I am running it from MAMP. MAMP has the ports set as; apache:8888, and MySQL:8889. do I have to change the settings anywhere else?