DB access problem in the first installation step.
-
Hi!
I am trying to install bbpress with WP 2.3.
In the config-file for bbpress I have written EXACTLY the same databasename, username and password as in the config-file for WP.
Still, when I run the install.php for bbpress I get several lines of “warnings”/error messages before the installation text “Welcome to…”
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user ‘nicuuorg’@’localhost’ (using password: NO) in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-includes/db-mysqli.php on line 80
Anyone understanding what’s going on.
The WP runs without any problems.
Could it be related to that the username is not correctly read from the config.php-file. The username is
nicuuorg_stefanj
, but access is denied for'nicuuorg'@'localhost'
according to the warning above.
-
Did you supply a password?
Does that database username have a password?
The error indicates there was none given.
Absolutely! The DB has a password and I wrote it correctly in the config-file.
I just read in another thread about other people experiencing the same problem, here:
Same with me, I tried a vanilla installation of bbPress 0.8.3 on my local machine, however, there is a slight difference:
I entered the ‘root’ as username in config.php, but the error itself is
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user ‘www-data’@’localhost’ (using password: NO) in /var/www/bbpress/bb-includes/db-mysqli.php on line 80
.
There does not exist a user called ‘www-data’ on my mysql-server and I am completely sure that I filled in ‘root’ in config.php.
I’ve started a trac ticket to keep track of this bug.
I just checked out r951 and I can duplicate this on a vanilla install without integration. I think the problem is with line 80 in db-mysqli.php:
if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
I think
mysql_get_server_info()
should be mysqli_get_server_info()Since the connection was made a couple lines earlier with @mysqli_connect, there is no mysql_connect link identifier, and none is passed in, so line 80 generates a warning and the setting of the charset errors out, and would never happen.
If you add the i to line 80, the warnings go away. I added my comments to the trac ticket.
Will try this later today. Seems like a solution!
The first warning disappeared!
Only three warnings left:
Warning: mysqli_get_server_info() expects exactly 1 parameter, 0 given in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-includes/db-mysqli.php on line 80
Warning: Cannot modify header information - headers already sent by (output started at /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-includes/db-mysqli.php:80) in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-admin/install.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-includes/db-mysqli.php:80) in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-includes/functions.php on line 1898Try changing line 80 from this:
if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
to this:
if ( !empty($this->charset) && version_compare(mysqli_get_server_info($this->$dbhname), '4.1.0', '>=') )
Fine, now the first step of the installation works.
During the second step the following warnings appear:
Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user 'nicuuorg'@'localhost' (using password: NO) in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-admin/upgrade-schema.php on line 6
Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-admin/upgrade-schema.php on line 6But the forums seems to run ok now!
The important thing to change in line 80 is from
mysql_get_server_info
to
mysqli_get_server_info
^There’s a letter I in there and it does not look like you changed that based on your error message. You also still need to have the $this->$dbhname as the parameter as well (maybe you already did that, but did not catch the I part.)
Well, I did change to “mysqli” on line 80 in db-mysqli.php.
Those latter warnings appeared during Step2 in the installation process, and is related to line 6 in upgrade-schema.php.
I have changed line 6 to
if ( version_compare($this->$dbhname, '4.1.0', '>=') )
but still get this warning:
Warning: mysqli_get_server_info() expects exactly 1 parameter, 0 given in /home/nicuuorg/public_html/neonatologyforparents/wp/bbp/bb-admin/upgrade-schema.php on line 6
PS. When I added $this->$dbhname inbetween the brackets “mysqli_get_server_info()” I got a fatal error during installation.
Stefan, take a look at this trac ticket:
https://trac.bbpress.org/ticket/745
mdawaffe is actively working on it.
mdawaffe’s most recent changes work for me. I applied the last patch he postet to that ticket and all warnigs disappeared.
Same here – works great
Excellent!! This needs to be made a sticky!!! 745c changes made it all good. Thank you!
I am still getting error after making all the recommended changes
Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, boolean given in /home/.mascot/digitalguruz/sheetudeep.com/bbpress/bb-includes/db-mysqli.php on line 80
Cannot select DB.Which changes did you make? Did you apply the 745c.diff patch from trac?
All right to make patches but why hasn’t there been a downloadable bug fix release yet? I got the same errors on a vanilla install from the most current version I downloaded from the site.
Gene
I believe the time for next release will be soon. If you like to try, you can check out the trunk, the installing process and options page are great!
I hope there’s a new release soon as well, but it doesn’t look like a date has been set yet?
https://trac.bbpress.org/milestone/0.8.4%20%26%20Pings
raygene: you can always download the latest development release which generally has all the discussed patches applied:
https://trac.bbpress.org/changeset/988/trunk?old_path=%2F&format=zip
There is always a link to the zip archive at the bottom of the trac browser.
The very latest trunk [988] is a little unstable.
You are better off with [980] the zip download of [980] can be found at the bottom of the following page:
There is still a set of problems with this. The value of
$this->$dbhname
isn’t checked before it’s used inmysql_get_server_info()
on line 75 indb-mysqli.php
. If the connection fails, the error won’t be echoed to the user because the use of@
on themysql_connect()
call and then the script just continues, assuming the connection went fine, which in my case, it din’t. Also, the call should be tomysql<b>i</b>_connect()
and notmysql_connect()
, as far as I can understand.The patch doesn’t fix these problems and they need to be fixed for bbPress to work on my host. I’d write these comments on the associated ticket, but there doesn’t seem to be any way to register or comment anonymously there.
745 is not for fixing unix socket connection.
Try this: https://bbpress.org/forums/topic/cannot-select-db-error?replies=11#post-12434
Which version of bbPress should I check out / download and apply the patch to? Trunk?
- You must be logged in to reply to this topic.