Wordpress: Error establishing a database connection. Yeah, I've tried that. And that

TomHagen

New Member
This is driving me nuts! I have a test instance of Wordpress installed on my MacBook Pro, which has suddenly stopped working. If I head for http://localhost:9003/wp-admin/ I get:\[quote\] 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 localhost. 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? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.\[/quote\]Hmmph! I haven't touched the config for ages. Here's how the relevant lines look right now:\[code\]define('DB_NAME', 'wordpress');define('DB_USER', 'wordpress');define('DB_PASSWORD', 'wordpress');define('DB_HOST', 'localhost');$table_prefix = 'wp_';\[/code\]The values are all good:\[code\]$ mysql -h localhost -u wordpress --password=wordpress \> wordpress -e 'select user_login from wp_users'+------------+| user_login |+------------+| simon |+------------+\[/code\]There's nothing in the MySQL error log, nor in Apache's error log. I've tried using a different MySQL user and a different database, but I get the same error. I'm scuppered - any WordPress gurus out there know what I'm missing?Output of php --ri mysql:\[code\]$ php --ri mysqlmysqlMySQL Support => enabledActive Persistent Links => 0Active Links => 0Client API version => mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $Directive => Local Value =http://stackoverflow.com/questions/3662860/> Master Valuemysql.allow_persistent => On => Onmysql.max_persistent => Unlimited => Unlimitedmysql.max_links => Unlimited => Unlimitedmysql.default_host => no value => no valuemysql.default_user => no value => no valuemysql.default_password => no value => no valuemysql.default_port => no value => no valuemysql.default_socket => /var/mysql/mysql.sock => /var/mysql/mysql.sockmysql.connect_timeout => 60 => 60mysql.trace_mode => Off => Offmysql.allow_local_infile => On => On\[/code\]
 
Back
Top