Recent Topics

PHP Upgrade to 5.6 causes MySQL Error

Started by on Jun 30, 2016 – Contents updated: Sep 29, 2016

Jun 30, 2016 13:33    

Hello

I am using the actual version of b2e 6.7.4. For security reasons I upgraded to PHP Version 5.6 and got an Error message:


Additional information about this error:

MySQL error!

Error selecting database [*****]!

    Are you sure the database exists?
    Are you sure the DB user is allowed to use that database?
    Are you sure there is a valid database connection?

In the logfile this was recorded


[Thu Jun 30 13:23:13 2016] [error] [client xx.xx.xx.xx] SQL ERROR: Error selecting database [***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "***" ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(10) ) File: /home/***/***/***/web/blogs/inc/_init_db.inc.php on line 35 require( "/home/***/***/***/web/blogs/inc/_init_db.inc.php" ) File: /home/***/***/***/web/blogs/inc/_main.inc.php on line 46 require_once( "/home/***/***/***/web/blogs/inc/_main.inc.php" ) File: /home/***/***/***/web/blogs/inc/_blog_main.inc.php on line 20 require( "/home/***/***/***/web/blogs/inc/_blog_main.inc.php" ) File: /home/***/***/***/web/blogs/notepad.php on line 47 Ignored last: 1, URL: http://www.***/blogs/notepad.php, referer: http://***/
[Thu Jun 30 13:23:13 2016] [error] [client xx.xx.xx.xx] b2evolution error: MySQL error! / Error selecting database [***]! /  / \t\t\t\t / \t\t\t\t\tAre you sure the database exists? / \t\t\t\t\tAre you sure the DB user is allowed to use that database? / \t\t\t\t\tAre you sure there is a valid database connection? in /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php at line 652 / REQUEST_URI:  /blogs/notepad.php / HTTP_REFERER: http://***/, referer: http://***/
[Thu Jun 30 13:23:19 2016] [error] [client xx.xx.xx.xx] SQL ERROR: Error selecting database [***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "***" ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(10) ) File: /home/***/***/***/web/blogs/inc/_init_db.inc.php on line 35 require( "/home/***/***/***/web/blogs/inc/_init_db.inc.php" ) File: /home/***/***/***/web/blogs/inc/_main.inc.php on line 46 require_once( "/home/***/***/***/web/blogs/inc/_main.inc.php" ) File: /home/***/***/***/web/blogs/inc/_blog_main.inc.php on line 20 require( "/home/***/***/***/web/blogs/inc/_blog_main.inc.php" ) File: /home/***/***/***/web/blogs/notepad.php on line 47 Ignored last: 1, URL: http://www.***/blogs/notepad.php, referer: http://www.***/blogs/notepad.php
[Thu Jun 30 13:23:19 2016] [error] [client xx.xx.xx.xx] b2evolution error: MySQL error! / Error selecting database [***]! /  / \t\t\t\t / \t\t\t\t\tAre you sure the database exists? / \t\t\t\t\tAre you sure the DB user is allowed to use that database? / \t\t\t\t\tAre you sure there is a valid database connection? in /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php at line 652 / REQUEST_URI:  /blogs/notepad.php / HTTP_REFERER: http://www.***/blogs/notepad.php, referer: http://www.***/blogs/notepad.php
[Thu Jun 30 13:23:27 2016] [error] [client xx.xx.xx.xx] SQL ERROR: Error selecting database [***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "***" ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(10) ) File: /home/***/***/***/web/blogs/inc/_init_db.inc.php on line 35 require( "/home/***/***/***/web/blogs/inc/_init_db.inc.php" ) File: /home/***/***/***/web/blogs/inc/_main.inc.php on line 46 require_once( "/home/***/***/***/web/blogs/inc/_main.inc.php" ) File: /home/***/***/***/web/blogs/inc/_blog_main.inc.php on line 20 require( "/home/***/***/***/web/blogs/inc/_blog_main.inc.php" ) File: /home/***/***/***/web/blogs/notepad.php on line 47 Ignored last: 1, URL: http://www.***/blogs/notepad.php, referer: http://www.***/blogs/notepad.php
[Thu Jun 30 13:23:27 2016] [error] [client xx.xx.xx.xx] b2evolution error: MySQL error! / Error selecting database [***]! /  / \t\t\t\t / \t\t\t\t\tAre you sure the database exists? / \t\t\t\t\tAre you sure the DB user is allowed to use that database? / \t\t\t\t\tAre you sure there is a valid database connection? in /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php at line 652 / REQUEST_URI:  /blogs/notepad.php / HTTP_REFERER: http://www.***/blogs/notepad.php, referer: http://www.***/blogs/notepad.php
[Thu Jun 30 13:23:43 2016] [error] [client 86.32.61.121] SQL ERROR: Error selecting database [***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "***" ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(10) ) File: /home/***/***/***/web/blogs/inc/_init_db.inc.php on line 35 require( "/home/***/***/***/web/blogs/inc/_init_db.inc.php" ) File: /home/***/***/***/web/blogs/inc/_main.inc.php on line 46 require_once( "/home/***/***/***/web/blogs/inc/_main.inc.php" ) File: /home/***/***/***/web/blogs/admin.php on line 37 Ignored last: 1, URL: http://www.***/blogs/admin.php?ctrl=crontab, referer: http://www.***/blogs/admin.php?ctrl=system
[Thu Jun 30 13:23:43 2016] [error] [client 86.32.61.121] b2evolution error: MySQL error! / Error selecting database [***]! /  / \t\t\t\t / \t\t\t\t\tAre you sure the database exists? / \t\t\t\t\tAre you sure the DB user is allowed to use that database? / \t\t\t\t\tAre you sure there is a valid database connection? in /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php at line 652 / REQUEST_URI:  /blogs/admin.php?ctrl=crontab / HTTP_REFERER: http://www.***/blogs/admin.php?ctrl=system, referer: http://www.***/blogs/admin.php?ctrl=system
[Thu Jun 30 13:23:46 2016] [error] [client 86.32.61.121] SQL ERROR: Error selecting database [***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "***" ) File: /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(10) ) File: /home/***/***/***/web/blogs/inc/_init_db.inc.php on line 35 require( "/home/***/***/***/web/blogs/inc/_init_db.inc.php" ) File: /home/***/***/***/web/blogs/inc/_main.inc.php on line 46 require_once( "/home/***/***/***/web/blogs/inc/_main.inc.php" ) File: /home/***/***/***/web/blogs/index.php on line 26 Ignored last: 1, URL: http://www.***/blogs/, referer: http://www.***/blogs/admin.php?ctrl=crontab
b2evolution error: MySQL error! / Error selecting database [***]! /  / \t\t\t\t / \t\t\t\t\tAre you sure the database exists? / \t\t\t\t\tAre you sure the DB user is allowed to use that database? / \t\t\t\t\tAre you sure there is a valid database connection? in /home/***/***/***/web/blogs/inc/_core/model/db/_db.class.php at line 652 / REQUEST_URI:  /blogs/ / HTTP_REFERER: http://***/admin.php?ctrl=crontab, referer: http://***/blogs/admin.php?ctrl=crontab

Stepped back to 5.5 to get my blogs running again. What to do?

Thanks and Regards
will

Jul 06, 2016 02:41

Don't delete your base config file when you upgrade and it will work fine.

Jul 06, 2016 09:16

The config file was not touched when upgrading the PHP from 5.5 to 5.6.
(It is no b2e upgrade problem, but an PHP update problem)

Jul 12, 2016 15:27

Hello there,
perhaps @gerardp knows how to handle this problem

my provider is able to reproduce the failure in addressing the db after upgrading PHP from 5.5 to 5.6
Because b2e is the only used application running into this malfunction, the provider points to b2e a the origin.

Could anyone please be so kind and check the error-log mentioned above, to check b2e problems (altough I know that it should run on 5.6)

This is, what my provider told me:

Ich habe mir das nun weiter angesehen.
Habe es mit einer neueren Mysql Version 5.5 (also neue Datenbank) versucht.

Leider auch kein Erfolg.
Software funktioniert mit PHP 5.6 und PHP 7 nicht.

Translation:

I have reviewed this again.
I have tried it with the most actual MySQL Version 5.5 (the new database)

Sorry, but without any success.
The software does not function with PHP 5.6 neither with PHP 7"

On your DEMO site you are running 6.6.6 with PHP 5.6.22; But you are not running 6.7.x - So may be b2e 6.7.x really encounters a PHP 5.6 incompatibility problem.

Thanks and Regards,
Will

Jul 12, 2016 18:50

php 5.6.23 running b2e 6.7.4 just fine here. Never had an issue. Also running MySQL 5.5 (actually MariaDB 5.5 but that doesn't make a difference in the app). Can't tell you why you're having the issue, but assuring you that b2e latest is compatible with php 5.6. Good luck.

Jul 12, 2016 19:54

@saunders the only reason I can think is that maybe your provider doesn't have the mysqli PHP module in his PHP 5.6 ?

Who is your webhost please?

No matter what, we are running the latest b2evolution very day on PHP 5.6 and also PHP 7.

Jul 12, 2016 20:57

@fplanque Good to know. Wanted PHP 7 but saw it wasn't done yet somewhere, so went with 5.6. Off-topic, I know.

mysqli is a default module in 5.6 so it's hard to believe they didn't have it (would have to go out of their way to do that). Also, it's returning errors about database existence, user access permissions, and the like, which would indicate to me that mysqli is present and working. If I had to guess, I'd have to agree that it sounds like the config file was changed.

@saunders Have you actually checked that the b2e config file wasn't changed? Don't just trust that the host didn't dig deeper than they needed. Open it up, compare to current database settings/name and be sure.

Jul 23, 2016 20:17

@btreece the config was not changed. By switching back form 5.6 to 5.5 b2e could be called without any problems.My provider (http://world"please transcribe four into a number an fill"you.com) in Linz, Austria insists that the problem is not a problem by their service. After I told them, that on other servers b2e is running on PHP 5.6 they stopped telling me, that it is a problem of the software. I think they are not really solution focused an want get rid of this work.
So I have to try to figure out what may cause this problem and to tell them. Then they are so generous to check this. I did this with mysqli PHP module. It is installed.
Here is the configuration Information:

Jul 23, 2016 20:43

Just a thought, but MySQL 5.1? @fplanque would have to confirm because I don't know that php 5.6 is compatible with MySQL 5.1. MySQL 5.4 is the minimum I keep seeing on other applications. I know that you need a higher MySQL version for InnoDB tables, per the php.net manual.

Aug 03, 2016 12:39

I switched to MySQL 5.5.32-log and tried again. Nope; same problem. I also tried to install b2e from the scratch. I could not succeed to run the installation process, because the db could not be detected although the entries have been correct.

Here is the error log:


[Wed Aug 03 12:00:17 2016] [error] [client 86.32.**.**] SQL ERROR: Error selecting database [1074236db***]!, QUERY: "", BACKTRACE: Backtrace: DB->print_error( "Error selecting database [1074236db***]!", "\\n <ol>\\n <li>Are you sure the database exists?</li>\\n <li>Are you sure the DB user is allowed to use that database?</li>\\n <li>Are you sure there is a valid database connection?</li>\\n </ol>", false ) File: /home/.sites/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 466 DB->select( "1074236db***" ) File: /home/.sites/***/***/web/blogs/inc/_core/model/db/_db.class.php on line 405 DB->__construct( Array(7) ) File: /home/.sites/***/***/web/blogs/install/_functions_install.php on line 1781 update_basic_config_file( Array(7) ) File: /home/.sites/***/***/web/blogs/install/index.php on line 482 Ignored last: 1, URL: http://www.***.net/blogs/install/index.php, referer: http://www.***.net/blogs/install/index.php?locale=de-DE

It is only b2e which shows that strange behavior. All other programs work fine with PHP 5.6
So I understand my provider, who interprets this as an evidence that this problem is not a server side problem.

Here is the error msg by the installer

Aug 05, 2016 01:40

Yes it does seem b2evolution works on any provider but them and that every script but b2evolution works on this provider.

So what do we do here?

I suggest we look at who is paying whom, who is a client of whom and who should take a little responsibility in helping their client.

Sep 27, 2016 12:04

@fplanque
Ok; I run a test on another provider. After updating to 6..7.6 all looks fine. Thanks for your patience.

Sep 28, 2016 14:01

About your screenshot above: did you configure your baseurl as 'http://localhost/...' ? That can only work on a local machine.

Sep 28, 2016 20:15

no; baseurl was configured http://testforphp.easynametest.com/. But disregarding the error message the installation works fine.(This was a test installation on another provider's server, to force my provider to take action)

And it worked: my provider of http://www.npo-consulting.net/blogs analyzed why b2e have not been working with php 5.6 and above: obviously some mysqli-Parameters in php.ini have not been set appropriate.

Thanks.


Form is loading...

free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.