Error connecting to the database

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
FedDgt
New user
New user
Posts: 7
Joined: 2023-07-03 14:33

Error connecting to the database

Post by FedDgt » 2024-01-08 12:31

Good morning,
I apologize for the inconvenience, I am new here.
I have installed hMail on a Windows 2019 server, and it was working fine until I was using Hyper-V. These days, I moved all virtual machines to VMware.
I transferred the virtual machines (database, hMail, etc.) and kept the same IPs. The database is on x.x.x.12, and hMail is on x.x.x.25, just like before the move.
As soon as I started hMailServer, I got this error (attached photo).
Checking in the database, the user is already set to 'caching_sha2_password.'
Can you tell me how to resolve this?

Thank you very much in advance.
Attachments
Screenshot 2024-01-08 112730.png
Screenshot 2024-01-08 112730.png (3.08 KiB) Viewed 2160 times
Screenshot 2024-01-08 112257.png
Screenshot 2024-01-08 112257.png (79.54 KiB) Viewed 2160 times

User avatar
RvdH
Senior user
Senior user
Posts: 3560
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Error connecting to the database

Post by RvdH » 2024-01-08 14:30

If i remember right hmailserver currently does not support the MySQL 8.x caching_sha2_password algorithm, you need to use legacy, eg: mysql_native_password
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
jim.bus
Senior user
Senior user
Posts: 1702
Joined: 2011-05-28 11:49
Location: US

Re: Error connecting to the database

Post by jim.bus » 2024-01-08 22:17

RvdH wrote:
2024-01-08 14:30
If i remember right hmailserver currently does not support the MySQL 8.x caching_sha2_password algorithm, you need to use legacy, eg: mysql_native_password
I believe RvdH is probably correct.

You do not say which version of hMailServer you are using. The official Latest version and official Beta versions are all 32 bit installations and consequently require you to use the Legacy option of MySQL 8 unless you are using, of course, an earlier 32 bit MySQL version like 5.7.

I have been using MySQL 8 with hMailServer 32 bit versions for a long time and I have to use the Legacy option of MySQL 8 when I install MySQL 8 because MySQL otherwise is a 64 bit version and a 32 bit version is not available. I believe I remember, though, that I read at some point that Legacy option will not be offered (possibly in a later version 8.x version). Also I believe you may need to make sure you use a MySQL 32 bit Client with hMailServer to be able to use the MySQL 8 database server.
If you think you understand quantum mechanics, you don't understand quantum mechanics.

User avatar
RvdH
Senior user
Senior user
Posts: 3560
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Error connecting to the database

Post by RvdH » 2024-01-08 23:20

jim.bus wrote:
2024-01-08 22:17
RvdH wrote:
2024-01-08 14:30
If i remember right hmailserver currently does not support the MySQL 8.x caching_sha2_password algorithm, you need to use legacy, eg: mysql_native_password
I believe RvdH is probably correct.

You do not say which version of hMailServer you are using. The official Latest version and official Beta versions are all 32 bit installations and consequently require you to use the Legacy option of MySQL 8 unless you are using, of course, an earlier 32 bit MySQL version like 5.7.

I have been using MySQL 8 with hMailServer 32 bit versions for a long time and I have to use the Legacy option of MySQL 8 when I install MySQL 8 because MySQL otherwise is a 64 bit version and a 32 bit version is not available. I believe I remember, though, that I read at some point that Legacy option will not be offered (possibly in a later version 8.x version). Also I believe you may need to make sure you use a MySQL 32 bit Client with hMailServer to be able to use the MySQL 8 database server.
He would have had a different error message is it was due to 32-bit / 64-bit mixup not? eg: "The MySQL client (libmysql.dll, 32 bit) could not be loaded. hMailServer needs this file to be able to connect to MySQL." or "The MySQL client (libmysql.dll, 64 bit) could not be loaded. hMailServer needs this file to be able to connect to MySQL."

caching_sha2_password is a plugin/module that does not exist for older libmysql.dll, it might work with libmysql.dll from 8.x series, but i still think you need to use the legacy option (not tested though)
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

FedDgt
New user
New user
Posts: 7
Joined: 2023-07-03 14:33

Re: Error connecting to the database

Post by FedDgt » 2024-01-09 11:39

RvdH wrote:
2024-01-08 14:30
If i remember right hmailserver currently does not support the MySQL 8.x caching_sha2_password algorithm, you need to use legacy, eg: mysql_native_password
Thank you very much, it worked. You've been extremely kind

telarc
New user
New user
Posts: 4
Joined: 2022-02-21 03:34

Re: Error connecting to the database

Post by telarc » 2024-11-11 21:16

As you know, you can solve this problem to hMailserver with password algorithm "mysql_native_password".
But "mysql_native_password" will not be supported in the future MySQL.

If you want to use "mysql_native_password" with "caching_sha2_password",
"mysql_native_password=On" in configuration file(my.cnf/my.ini).
If so, Mysql use default "caching_sha2_password" and additional "mysql_native_password" also.

Post Reply