By idenr on
I have the following:
- OS X 10.4.5 Mac OS
php 4.4.1
Drupal 4.6.6
mysql 4.0.17
I get the following error when I try to http://localhost/drupal/:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 31
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)I have been following the directions of the article http://maczealots.com/tutorials/drupal/#step1
I can log in to mysql using the account I established in my $db_url variable (root) in my settings.php file so I assume that mysql is running with no problem.
phpmyadmin won't run either and it gives me the error:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
I used to have phpmyadmin running but that was before I upgraded from system 10.3.9 to 10.4. I don't know if this could be a Tiger issue.
So it seems my problem is with my server's socket configuration. It sounds like it might be a simple newbie issue? What can I check?
Comments
re
Navigate to /sites/default/settings.php in your root folder.
Change the mysql/password etc to the correct values.
also chage the URL $http://yoursitename.com$
Should be it.
/edit
Oh sorry, I re-read your post. Check for typos in settings.php
Local socket?
It sounds like you've configured PHP to connect via a local socket (eg /var/mysql/mysql.sock) rather than a TCP socket (eg hostname:port)
http://www.php.net/manual/en/function.mysql-connect.php
Is your MySQL server configured to listen for TCP connections?
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal
If it is
If it is configured for TCP/IP using
127.0.0.1instead oflocalhostin$db_url(in settings.php) may help.--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
Changing to 127.0.0.1 from localhost worked!
Thank you for your helpful suggestion. Now I have to find out what's wrong with phpMyAdmin :-)
Thanks again.
That works
On OS X (as opposed to localhost.local !).
http://www.universalpantograph.com/os-x-and-os-x-server-mamp-install-dru...
Its a 10.4 bug
Not really a bug, my understanding is that its a security related change. I don't have a handy solution, but this might be helpful:
http://docs.info.apple.com/article.html?artnum=301457
This is related to 10.4 server, but I suspect the two issues are the same.
I don't own a Mac but,
The tutorial referenced in your post mentions nothing about PHP-Extensions. Are PHP-Extensions installed? Look on your "phpinfo" page.