coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 upgrading => Topic started by: Aurel Klatik on June 11, 2025, 10:03:53 PM

Title: Unable to connect to database !
Post by: Aurel Klatik on June 11, 2025, 10:03:53 PM
I have successfully updated from CPG 1.5.12 to 1.5.48 using PHP 5.3
In attempt to upgrade to CPG 1.6.26 I have uploaded files to server, changed server setting to PHP 8.3 and run webname/update.php
I was still logged in as webstie admin.  Got this error:

Coppermine critical error:
Unable to connect to database !

MySQLi said: 2054 : The server requested authentication method unknown to the client [mysql_old_password]

Have checked that MySQL is 5.5
I have no clue what to do. Can you please give me a hint ?
Title: Re: Unable to connect to database !
Post by: phill104 on June 14, 2025, 12:12:53 PM
Take a look at your include/config.inc.php file and check all the setings are correctly pointing to your database. Once you have verified they are correct remember to run update.php as per the docs

https://coppermine-gallery.com/docs/curr/en/upgrading.htm

QuoteTo run the PHP-file "update.php" (i.e. the update script), just enter the URL into the address bar of your browser. The file "update.php" resides in the Coppermine directory, so to run it you will need to point your browser to http://yourdomain.tld/your_coppermine_folder/update.php (if you have installed Coppermine into the root of your web site, you will have to run http://yourdomain.tld/update.php accordingly). This will update your Coppermine install by making all necessary changes in the database.



Title: Re: Unable to connect to database !
Post by: Aurel Klatik on July 08, 2025, 10:16:53 PM
I have checked include/config.inc.php and it is fine
>>Having noticed in my old file this line was missing:
$CONFIG['dbtype'] =      'mysqli';      // Your database type
>>and this line was
$CONFIG['TABLE_PREFIX'] =         'cpg14x_';
>>and not
$CONFIG['TABLE_PREFIX'] =         'cpg16x_';
>>tried to add missing line and change 'cpg14x_'; to 'cpg16x_';
>>but it did not solve anything, there i sill
Coppermine critical error:
Unable to connect to database !
MySQLi said: 2054 : The server requested authentication method unknown to the client [mysql_old_password]
Title: Re: Unable to connect to database !
Post by: ron4mac on July 09, 2025, 02:45:46 PM
If you are using a commercial host, present the issue to them. They would need to configure mysql to accept standard passwords.
If you are self-hosting, you will need to determine the mysql authentication method being used and make appropriate adjustments. This may help (https://www.digitalocean.com/community/tutorials/how-to-install-lamp-stack-on-ubuntu#step-2-installing-mysql).
The TABLE_PREFIX should remain as the original cpg14x_.
The [dbtype] gets updated when update.php successfully runs.
Title: Re: Unable to connect to database !
Post by: Aurel Klatik on August 02, 2025, 08:09:02 PM
Problem solved.  Thank you for your support.
It was unable to connect to database because of password did not meet requirements (capital letter, number ...)
In PHP5 with CPG 1.5 it worked, but after switching to PHP8 for CGP 1.6 update it didn't.
Finally database password change solved the problem.
I have upgraded to CPG 1.6 successfully.