After Snow Leopard can't connect to remote db


#1

I have several wordpress sites that I have setup locally to use the remote mysql db. This helps avoid duplication in your testing and production environments.
Since upgrading to Snow Leopard the ability to connect to remote dbs has been obliterated. I found an explanation on stack over flow:

"I have resolved this. The issue indeed was due to Snow Leopard’s default of using mysqlnd as the module for PHP 5.3 it ships with, not with Dreamhost. That module flatly refuses to connect with servers using OLD_PASSWORD hash.

The only solution to this (as I can’t change MySQL settings on shared hosting) is to recompile your own PHP, that will not use mysqlnd but mysql/mysqli."

I am asking here to see if anyone else has had this problem and foudn an easier solution than recompiling php.


#2

At the present time, this is the only solution available. Sorry for the inconvenience.


#3

Any chance Dreamhost could be persuaded to stop specifying OLD_PASSWORD in the MySQL config?


#4

Not yet. We still have some users using older applications that may not support the newer password format – using the newer password format would end up locking them out of their databases.


#5

Apple don’t offer drop-in modules?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#6

Since the last message on this thread is over a year old, I’d like to ask if there’s been any change on DH’s end or if I should still use the linked StackOverflow post to get this working. Anyone?


#7

We’ve since switched to a newer version of MySQL and switched things to the new password format. You shouldn’t need to do anything extra anymore.


#8

Thanks very much for the quick reply, then!


#9

Finally getting a chance to try this and it’s failing to connect to the DB… Here’s what I’ve done:

  1. copied the entire contents of the site (WordPress is installed at the public root) to ~/Sites/mySite/
  2. modified the local version of wp-config to include:
    define(‘WP_HOME’, ‘http://localhost/~myUserName/mySite/’);
    define(‘WP_SITEURL’, ‘http://localhost/~myUserName/mySite/’);
    define(‘WP_DEBUG’, true); // enable debugging mode

When I try to hit http://localhost/~myUserName/mySite/ in a browser, I get the WordPress DB connection error screen:

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at mysql-1.myHostName.com. This could mean your host’s database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure that you have typed the correct hostname?
  • Are you sure that the database server is running?

I haven’t changed the DB_HOST value:

define(‘DB_HOST’, ‘mysql-1.myHostName.com’);

Do I need to change that to get it working? The production site is still running fine, so I know the db server isn’t down. I can successfully ping mysql-1.myHostName.com from Terminal.


#10

Chances are that your MySQL user isn’t set to allow connections from your home IP - by default, it only allows connections from DreamHost servers. Head over to the MySQL section of the Panel (https://panel.dreamhost.com/index.cgi?tree=goodies.mysql), click the name of the user you’re using to connect, and add your home IP in the box at the bottom.


#11

Thanks! Should’ve been obvious, I guess.