Go Back   The macosxhints Forums > OS X Help Requests > OS X Server

Thread Tools Rating: Thread Rating: 5 votes, 4.80 average. Display Modes
Old 06-21-2005, 11:48 AM   #1
Join Date: Jun 2005
Posts: 2
Exclamation Wordpress problem on OS X Server 10.4.1

I'm getting the same "Error establishing a database connection" message. I have a fresh install of Mac OS X Server with all updates. I have the web server service started with the PHP enabled. Any ideas? Thanks!

details here:
mtbikemj is offline   Reply With Quote
Old 06-21-2005, 05:11 PM   #2
Major Leaguer
Join Date: Apr 2002
Location: Haverford, PA
Posts: 343
Have you tried manually resetting your password? I had this problem and issued the following command and have had nothing but joy since:

mysql> SET PASSWORD FOR 'username'@'host' = OLD_PASSWORD('newpassword');
Obviously, replace username, host, and newpassword as appropriate.

dhayton is offline   Reply With Quote
Old 06-21-2005, 09:23 PM   #3
Join Date: Dec 2004
Posts: 14
I've just sorted this one out myself. It seems PHP and MySQL don't communicate properly out of the box using Tiger Server. Here's what to do:

1. Fire up MySQL Manager (Applications/Server/MySQL Manager) and ensure MySQL is installed. Also double check the PHP4 module is enabled in your Apache settings. If it isn't, enable it and restart the service.

2. Start up MySQL. We need to ensure that a particular SQL directory is created so we can tweak it later on.

3. Open Terminal and type sudo cp /etc/php.ini.default /etc/php.ini

4. Open /etc.php.ini in your a text editor and add /var/mysql as the default MySQL socket. It should read:
mysql.default_socket = /var/mysql/mysql.sock
5. PHP should now know where to look. Make sure the directory can be read: sudo chmod 755 /var/mysql and close your text editor.

6. Type mysql -h localhost -u root -p and enter the root password.

7. Replacing the coloured text with your own choices, at the MySQL prompt, type:
GRANT ALL PRIVILEGES ON wordpress.* TO word@localhost IDENTIFIED BY 'password';
SET PASSWORD FOR word@localhost = OLD_PASSWORD('password');
8. Point your browser to http://localhost/wordpress/wp-admin/install.php (or wherever install.php resides in WebServer/Documents). Finally, hit return and pray.

Sorry for stating the obvious here but I figured it would make the post easier to follow for people with no experience of the CLI (like me, last week).

Good Luck!

Last edited by iVoltage; 06-21-2005 at 09:26 PM.
iVoltage is offline   Reply With Quote
Old 06-22-2005, 01:43 PM   #4
Join Date: Jun 2005
Posts: 2
That worked! YOU RULE! One more note, restart webserver before you pray!
mtbikemj is offline   Reply With Quote
Old 09-14-2005, 05:52 PM   #5
Registered User
Join Date: Sep 2005
Posts: 1
Originally Posted by iVoltage
4. Open /etc.php.ini in your a text editor and add /var/mysql as the default MySQL socket. It should read:
mysql.default_socket = /var/mysql/mysql.sock

Thanks for solving this problem!

Please tell me, how could you edit the /etc/php.ini file in an ordinary text editor?
The file is normally not writeable.
philaweb is offline   Reply With Quote
Old 08-08-2006, 11:38 AM   #6
Join Date: Jan 2002
Posts: 1

This thread is linked to from the WordPress forums (http://wordpress.org/support/topic/34738) which also highlight another potential problem / solution.

The above didn't work for me however changing DB_HOST to rather than localhost seemed to work.
j0nathan is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 11:49 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.