Error With Pre-installed Postgresql For Mac
When installing on Mac OS X, using its pre-installed version of PHP but a later, downloaded install of MySQL (eg., 5.1, etc.), in the last part of the Drupal install, you may get a, 'Error establishing a database connection.' First make sure the database name, username and password are all correct as you set them up. The problem then may be in how Mac OS X connects to the database host on a local machine. Normally, in Drupal UI install, when testing on your own machine, this defaults in the 'Host' field as, 'localhost.' The quick and dirty work around, especially if this is just set-up for testing, is to change the case of of 'localhost' to 'Localhost.' Then it should work. The more complete fix is type the following into a shell: $cp /etc/php.ini.default /etc/php.ini $sudo chmod +w /etc/php.ini Then in 'php.ini' in an editor, change the line reading as: mysql.defaultsocket.
To: mysql.defaultsocket = /tmp/mysql.sock Then restart the Apache server on the Mac and it should be fixed. This happens also on Wordpress, and a friend forwarded me this fix when I ran into the same problem installing Drupal on Mac OS X 10.5.6 Leopard with MySQL 5.1, from this WordPress fix detailed on this site about Mac Wordpress Error establishing a database connections. I just wasted the last day trying to figure out why my local installation of drupal wasn't working. I found this page - yay!
- and the answer to try 'Localhost' instead of the industry-standard 'localhost' worked. Which is great.
But, what's.NOT. great is that this is a bug.
This is.still. a bug. The original post is from 2009! If this is a well-known issue, then please put it in the README file or even in the installation. ('If you are installing this on a Mac, please try 'Localhost' under Advanced.' ) Or, hell, make the change yourself! I've installed WordPress several times on several Macs since 2009 and.never.
has this been an issue. So, either it's not a global issue (i.e., it's drupal's fault) or they've figured out how to address the issue. I hope Drupal does, too. or to post comments.
Upon every login to my computer, I notice in Activity Monitor I have several instances of a process called 'postgres' running, under the user 'postgres'. What is this, and why does it launch every time I log in? From what I gathered, it is an SQL server that is built into Unix systems. But that is as far as I got. Any insight would be much appreciated. It appeared after I installed Blackmagic's DaVinci Resolve. When it installs the CUDA package, it also installs the PostgreSQL server.
Postgresql Error Handling
Is a relational database engine. You might have heard of MySQL? It does a similar sort of job. Apple, for reasons unscrutable and strange, decided that they wanted to bundle PostgreSQL in some Mac OS X versions as a pre-installed application.
Postgresql Mac Install
Consequently it comes with some versions of Mac OS X. Additionally, some 3rd party software will bundle PostgreSQL because it uses it to store and manage its data. It won't always be obvious what the program is. PostgreSQL generally uses little CPU, RAM or disk I/O unless it's actually being used for serious work, so it's fairly safe to ignore it. If you're really determined to get rid of it (say, you think it might be stopping your non-SSD-based mac from spinning down its hard drive) then stop it and leave it installed but not running. If nothing breaks, disable it in launchd, but do not uninstall it.
That way it has no effect but is easily restored if you discover there was a problem after all. (Note that PostgreSQL databases aren't compatible across versions. If you delete an installed copy of 8.2 then decide you wanted that data after all, you would have to install a compatible build of 8.2 to read the data; installing the latest 9.3 release, or even 8.4, would not work).