Database error on installation


When installing Omeka, just after adjusting parameters on db.ini and config.ini, and pointing to the site, the browser show this error:

Omeka Database Error
The server requested authentication method unknown to the client.
Confirm that the information in your db.ini file is correct.

The db.ini file is not complex at all. Having few parameters, is difficult to get in a mess with it. Anyway, I have double checked the values:

 host     = "localhost"
 username = "omeka"
 password= "the-right-password-of-course"
 dbname   = "omekadb"
 prefix   = "omekadb_"
 charset  = "es_MX.UTF-8"

I’ve checked the mysql database and permissions too. All fine.

Changing the config.ini for retrivieng better error messages doesn’t help too much.

The apache error log is this:

Omeka fatal error: The server requested authentication method unknown to the client.\n\nConfirm that the information in your db.ini file is correct.

So… Any idea what am I doing wrong??

By the way, my setup:


Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

PHP 7.3.19-1~deb10u1 (cli) (built: Jul 5 2020 06:46:45) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright © 1998-2018 Zend Technologies with Zend OPcache v7.3.19-1~deb10u1, Copyright © 1999-2018, by Zend Technologies

mysql Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)

Server version: Apache/2.4.38 (Debian)
Server built: 2020-08-25T20:08:29

apache modules enabled:
authz_core (enabled by maintainer script)
authz_host (enabled by maintainer script)
authn_core (enabled by maintainer script)
auth_basic (enabled by maintainer script)
access_compat (enabled by maintainer script)
authn_file (enabled by maintainer script)
authz_user (enabled by maintainer script)
alias (enabled by maintainer script)
dir (enabled by maintainer script)
autoindex (enabled by maintainer script)
env (enabled by maintainer script)
mime (enabled by maintainer script)
negotiation (enabled by maintainer script)
setenvif (enabled by maintainer script)
filter (enabled by maintainer script)
deflate (enabled by maintainer script)
status (enabled by maintainer script)
reqtimeout (enabled by maintainer script)
rewrite (enabled by site administrator)
mpm_prefork (enabled by maintainer script)
php7.3 (enabled by maintainer script)

Thanks in advance.

I think the issue here has to do with MySQL 8 vs. the MySQL support installed in PHP on your server.

MySQL 8 defaults to a new authentication method versus previous versions, called caching_sha2_password. I believe the MySQL client libraries in PHP don’t support that until PHP 7.4. So updating PHP could resolve this problem.

The other option is to change the database user to use the old authentication method:

ALTER USER omeka@localhost IDENTIFIED WITH mysql_native_password BY 'the-right-password-of-course';

ok. I’ve tried the ‘alter’ method and it throws this error on browser:

[Fri Oct 30 20:48:32.791851 2020] [php7:error] [pid 31347] [client] PHP Fatal error: Uncaught RuntimeException: Error log file cannot be written to. Please give this file read/write permissions for the web server. in /var/www/omeka/application/libraries/Omeka/Application/Resource/Logger.php:33\nStack trace:\n#0 /var/www/omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(695): Omeka_Application_Resource_Logger->init()\n#1 /var/www/omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(638): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource(‘logger’)\n#2 /var/www/omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(598): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(‘logger’)\n#3 /var/www/omeka/install/install.php(41): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap()\n#4 {main}\n thrown in /var/www/omeka/application/libraries/Omeka/Application/Resource/Logger.php on line 33

The permissions are 775 on directories and files. Is this correct?

This error is just because you have enabled error logging but not made the log file writable by the server.

If the log file shares its group with the PHP execution user, then 775 would be sufficient. Typically on Ubuntu servers, the group www-data is used for this purpose.

I should also note:

You’ve replaced the default utf8 in the charset parameter in db.ini with es_MX.UTF-8. That’s not a good idea. I’m not sure what it will do, but the charset there is a MySQL setting, not a Unix locale like you’ve given there. At best, the es_MX part would have no effect. I’m actually surprised it’s not causing an error on its own.

Leaving it at its default of utf8 is best.

Right. utf8 is set now.

The user and group is actually www-data. But to shorten path I just disable the error logggin :wink:

Then the browser did show a styled html notifiying there was another error: DOM extension for PHP was not available.

So I did install the proper package: apt install php-xml. Then restarting Apache does the trick: systemctl restart apache2.

Now, we could reduce this unknown authentication method issue to the mysql version conflict, right??

Thank you so much!

Yes, the “unknown authentication” was definitely related to the MySQL version mismatch.

So you’re now error-free, I think?

Yes. Now is working fine.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.