I am trying to get Drupal up and running on my MacBook again. (I have created several sites in the past but, I deleted them in order to start over). But when, during the setup process, I try to connect to the database, I get the following error message:
-------------------------------
Failed to connect to your MySQL database server. MySQL reports the following message: No such file or directory.
* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct database hostname?
* Are you sure that the database server is running?
For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.
-------------------------------
I have verified that I am using the correct login name, and the correct password. I have also verified that MySQL server is running. (I can connect to the database using MySQL Tools)
Can anyone suggest some steps to debug this?
--NOTE: I just tried creating a Symbolic Link at /var/mysql/mysql.sock that points to the actual location of the mysqld.sock file [notice the difference in the file name "mysqld.sock" not "mysql.sock"]. It did not work.
Thanks in advance for any advice you can give.
Comments
=-=
if username and password are known to be correct what about DB location?. I assume you've left it as default which is localhost?
thank you for your
thank you for your reply.
Yes, I left it at the default location of "localhost".
I wonder if it is the location of the socket.
Here is the location of the .sock file on my macbook:
/opt/local/var/run/mysql5/mysqld.sock
I do believe this may not be "standard" for the location. Maybe Drupal thinks the socket is somewhere else?
That is why I tried the symbolic link file that I mentioned in my original post. It didn't work but, maybe I was on the right track and just got some detail wrong?
I will keep pecking away at it but, any suggestions would really be appreciated.
Thanks.
problems setting up Drupal
Hi
* $db_url = 'mysql://username:password@localhost/databasename';
When I started to install Drupal on to the host server I amended the settings.php to include the 'username, password and database' but had taken out @localhost, thinking that I didn't need it - this resulted in the error msg
##########
Failed to connect to your MySQL database server. MySQL reports the following message: Access denied for user 'travlorg'@'localhost' (using password: NO).
##########
looking at your reply, it gave me the clue '@localhost' so added that line back in and it now works, cheers
Solved - It is Snow Leopard
I finally searched on the correct terms and found lots of posts about MySQL and Snow Leopard. I recently upgraded to Snow Leopard without knowing about the issues involved so, now I will need to reinstall MySQL, it seems.
So, this is a known issue.
Same issues too
rogdawg - I'm also trying to install Drupal (for the first time) and I've encountered the very same thing too. After my upgrade to snow leopard I have had various issues with MySQL5 and even after a reinstall of MySQL5 things were not right.
I found this thread http://forums.macrumors.com/showthread.php?t=374993 and found that entering mysql.default_socket = /private/tmp/mysql.sock in php.ini helped.
This got phpMyAdmin running and I have been able to install WordPress, Joomla, Slideshow Pro Director but like you I'm unable to install Drupal.
If you make any progress, please could you share that here.
Thanks
Some progress
You might be interested to know that installing Drupal 7 appears to have worked. However using the very same MySQL5 settings (db username password localhost etc) on the D6.15 installation fail with the "Failed to connect to your MySQL database server. MySQL reports the following message: No such file or directory" message.
I read lots about incompatibility between D6 and php5.3 (which is standard on Snow Leopard) and peoples various fixes, mostly being to downgrade to php5.2. But then I also read that the incompatibility issues were meant to have been fixed in D6.15, however the installation still fails for me.
I'm only playing with Drupal, so guess I'll try out the dev version of D7.
Still, if you do get D6 and php5.3 working then I'd be keen to hear.
=-=
There was a patch that went in for D6 that was supposed to make D6 compatible with PHP 5.3 however, even I haven't been able to get that to work. Beyond that most contrib modules aren't updated to use PHP 5.3.
I found it much easier to roll back PHP to 5.2.x to get a working D6 install
php5.2
vm - out of interest what approach did you take to rolling back to php5.2? Did you download an *AMP or did you roll your own php5.2?
I'm a newbie to this kind of fixing - does the 5.2 sit alongside 5.3, or does it replace it? What happens if Apple release an update (to say 5.3), does that start to get messy?
Cheers
=-=
I don't use and Apple environment so I can't guide there. I use windows and in windows I use WAMP.
With WAMP, I can tell it what version of PHP to get and use. I can toggle between versions 5.3 and 5.2.x but I can't run them both at the same time. Matter of fact, since I turned off PHP 5.3 to use 5.2.x I've not turned 5.3 back on and likely won't until D7 is released as a point release.
D6 up and running
vm - thanks for sharing that. I decided to try and get Drupal 6 working for the reason you say and went down the Macports route and downgrade to php5.2. Its all working now ...
I followed http://2tbsp.com/content/install_apache_2_and_php_5_macports and installed php52 +apache2 +mysql5. All went relatively smoothly (taking about 1.5hrs to complete) but there was an issue with sockets. This only seemed to impact Drupal as phpMyAdmin and WordPress worked right away.
The sockets fix for Drupal I found here http://drupal.org/node/198810. After following this the install of 6.15 connected to mysql and completed successfully. Note, I decided to use my previous download of 6.15 rather that trying the Macports install drupal6 approach.
Macports creates separate installs in /opt/local/ for the applications (ports) that you download e.g. php, mysql. This means that they do not conflict with those shipped with the Mac OS, meaning that you should always be to turn these back on if you needed to (at least that is the theory ... I have as yet to try this).
The only downside to this setup is that I cannot use the Web Sharing function in System Preferences, instead I have to turn this off and on via the terminal command line.
SOLVED (Snow Leopard) - Simpler than you'd imagine
I ran into this error while installing drupal 6.16 on Mac OS X (Snow Leopard).
Doing a finder lookup for "mysql.sock" brought up no results. So, I decided to connect by IP instead of connecting by Socket, and bang! it worked.
When you connect to mysql through localhost it attempts to connect via mysql.sock where as connecting via 127.0.0.1 works direct.
Cheers,
Zuhair Naqvi
Thanks Zuhair! I have been
Thanks Zuhair! I have been stuck on this part of the installation for a day--all the other solutions to this issue I've seen seemed overkill. I signed up for an account on drupal.org just to express my gratitude. :-)
Thanks,
--Dan
You're most welcome Dan
You're most welcome Dan :-)
I've been playing with really awsome Symfony based CMF called diem, check it out http://www.diem-project.org/
Cannot connect to database - Please offer debugging suggestions.
Hi All,
Pls i have excatly same prob with this guy. The only diff is that iam on windows rather than mac, pls what do i do. I am using php 5.3.5 and Mysql 5.5.8. Prompt response will be appreciated.
Rgds
Confirm on mac osx 10.9 / mysql 5.6.16 / drupal 6.20
I confirm that this problem occurs on mac osx 10.9 / mysql 5.6.16 / drupal 6.20
The solution is, indeed as Zuhair says, to enter 127.0.0.1 as database host