php 5.4 brings error 'cannot connect to database'

Started by beckett, November 29, 2012, 08:05:37 PM

Previous topic - Next topic

beckett

Hi,

My host 1&1 is changing the default PHP version to 5.4 on 1st April 2013.

When testing the forum using this version I get the 'Cannot connect to database' error.

Is this a problem with the host configuration, php 5.4 or SMF and is there something I can do to fix it?

My thanks

Beckett

emanuele

Hello beckett and welcome to sm.org.

Could you please provide a phpinfo?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

beckett

Hi emanuele,

Here is a RAR archive containing both Versions 5.2.17 and 5.4.9 saved as HTML pages.

My thanks

Beckett

emanuele

Can you please try the attached file with php 5.4 and report the results?

Put it in the same directory as Settings.php and open it in your browser (so http://yoursite.tld/forum/php_54.php).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

relidl

I'm also having this problem with my 1and1-hosted forum.  Here is the output of the php_54.php file:


Failed to connect to MySQL with mysql_connect ()

Warning: mysqli::mysqli(): Connecting to 3.22, 3.23 & 4.0 is not supported. Server is 4.0.27-max-log in .../forums/php_54.php on line 12

Warning: mysqli::mysqli(): (HY000/2054): Connecting to 3.22, 3.23 & 4.0 servers is not supported in .../forums/php_54.php on line 12
Failed to connect to MySQL with mysqli: (2054) Connecting to 3.22, 3.23 & 4.0 servers is not supported

emanuele

I think its best if you ask them for details about mysql and php 5.4...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

beckett

Hi emanuele,

Here is the output from php 5.4.9 - it works fine with 5.2:

Failed to connect to MySQL with mysql_connect ()

Warning: mysqli::mysqli(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /homepages/25/d169016114/htdocs/arunachala-ramana.org/forum/php_54.php on line 12
Failed to connect to MySQL with mysqli: (2000) mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file

Best wishes

Beckett

emanuele

As it says you have to do something with the mysql password.
If you are unsure of the consequences I'd suggest to contact the 1and1 support and ask for clarifications. ;)

ETA: SMF use "original" MySQL php API, not the MySQLi, so if you are going to contact them highlight this too, just in case. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

relidl

I was able to resolve this issue by moving from a mysql4 db to a mysql5 db.

I had to export the db to a file, then import it by hand in php mysqladmin 10,000 lines at a time.

beckett

Hi emanuele,

I was able to resolve the problem by re-entering the password via the 1&1 MySql admin facility.

Thank you for your expert help.

Best wishes

Beckett

emanuele

Good to know!
And thanks both to take time to report back the solution. :)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

dgromova

Quote from: beckett on December 01, 2012, 03:16:57 AMI was able to resolve the problem by re-entering the password via the 1&1 MySql admin facility.
Hi beckett. I have exactly the same host and the same problem. Did I get you right? You re-entered the database password (which is located at config.php file) and it worked? I've done it too but it didn't work for me.

Tyrsson

PM at your own risk, some I answer, if they are interesting, some I ignore.

WanderingRover

I had a similar issue (also with 1&1) but when I went to the MySQL database list, I found that the SMF database was running v4.0, so I exported the data to a file, created a new v5.0 database and re-imported it all.  I had to actually import it in chunks because it was timing-out even with a 5MB data import.  I then updated my settings.php file with the new database address, name and password and it was up and running just minutes later.  Hope this helps!

woden

Resetting the password in mysql databases fixed mine right up. I appreciate the info.

Advertisement: