I moved a site - actually copied a production site to a development region.
The site is working in the development region, including CiviCRM, but the CiviCRM cron job fails:
Jun 29 16:33:02 [info] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] => [nativecode=mysql_connect(): Access denied for user 'hostuser_drupal'@'localhost' (using password: YES)]
[type] => DB_Error
[user_info] => [nativecode=mysql_connect(): Access denied for user 'hostuser_drupal'@'localhost' (using password: YES)]
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [nativecode=mysql_connect(): Access denied for user 'hostuser_drupal'@'localhost' (using password: YES)]"]
)
I can log into the site as the same user that the cron job is using, and everything works. But the cron job fails, saying that the Drupal database user is denied.
There is a Drupal database and a CiviCRM database. There is a MySQL user for each database. At this point, both users have access to both databases.
Obviously the credentials in the config files are correct, since Drupal and CiviCRM work as normal in the browser. But the cron task fails as described above, whether called by cron or by using the cron URL in the browser.
Here is the cron job:
wget -O - -q -t 1 'http://somedevsite.com/sites/all/modules/civicrm/bin/cron.php?name=admin&pass=33333333333333&key=44444444444444444444444444444444'
What could be going on?
EDIT I switched the cron task to call /civicrm/bin/cli.php directly (via php) and it fails in exactly the same way.