Database Errors with a Local Install of bbPress 0.8.3
This is filed under the heading “I don’t know why the solution works, but it does, and that’s good enough for me”.
The YLF forum is currently based on bbPress 0.8.3 (great forum system, more on that in future posts). I was setting up a development server to test some new features and hit a strange error. For the record, my server is using WampServer 2.0c on a Vista SP1 PC. WampServer is great if you have a LAMP (Linux OS, Apache webserver, MySQL database, and PHP) production server and want an equivalent setup on your local Windows PC.
During the bbPress install, which is normally just as simple as the WordPress install, I got the following database warnings:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user ‘ODBC’@'localhost’ (using password: NO) in C:\xampp\htdocs\bbpress\bb-includes\db-mysqli.php on line 80
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in C:\xampplite\htdocs\bbpress\bb-includes\db-mysqli.php on line 80
Who exactly is “ODBC”, and why is he trying to access my database without a password? After much futzing with the database settings and the BBPress config, I starting looking around the web for a solution. Fortunately, it wasn’t long before I found one. No explanation for why it works, but it does.
In the file “bbincludes/db-mysqli.php”, change…
if ( !empty($this->charset) && version_compare( mysql_get_server_info(), '4.1.0', '>=') )
$this->query( "SET NAMES '$this->charset'" );
to…
if ( !empty($this->charset) && version_compare( mysqli_get_server_info( $this->$dbhname ), '4.1.0', '>=' ) )
$this->query( "SET NAMES '$this->charset'" );
Now, this does involve modifying a file in the bbPress distribution, which I would normally avoid. But in this case I just want the development server up and running asap, so I will live with the hack.
Posted: August 17th, 2008 under Development.
Tags: bbPress, Database, Intermediate