Cannot connect to myql 8 (using password: NO)

There is already a bug with “similar, but not identic” symptoms, so please decide if this is a different issue or a duplicate.

My Situation is:
Metabase v0.32.1
mysql 8.0.15
hosted on same machine (my workstation) on Windows 10

Symptoms are: try to configure a valid mysql database.
On first run, the UI states “Access denied for user ‘root’@‘localhost’ (using password: NO)”
The log says
04-03 10:13:46 e[1mINFO driver.mysqle[0m :: You may need to add trustServerCertificate=true to the additional connection options to connect with SSL.
04-03 10:13:46 e[1mDEBUG middleware.loge[0m :: POST /api/database 400 (5 ms) (0 DB calls).
{:valid false,
:dbname “java.sql.SQLInvalidAuthorizationSpecException: Access denied for user ‘holzer’@‘localhost’ (using password: NO)”,
:message “java.sql.SQLInvalidAuthorizationSpecException: Access denied for user ‘holzer’@‘localhost’ (using password: NO)”}

As suggested; I added the “trustServerCertificate=true” option to the “Zusätzliche JDBC-Verbindungs-String-Optionen” --> No effect (except that the hint in the log is missing)

Hi @Boris

It seems like you’re not using a password, when connecting to MySQL from Metabase.
You should also have a look in your MySQL log for more details.

And I don’t understand why first connection is using 'root'@'localhost' and then the other connections are using 'holzer'@'localhost' - are you trying with different users?

Hey Flamber,

sorry that I mixed up my two independent trials with ‘root’ and ‘holzer’ - none of them was successful :slight_smile:
In both cases, I definitely used a password !
I downgraded from mysql 8 to mysql 5 - then it works.


Ahhh, okay, then you should have the following error in the log too:

ERROR metabase.driver :: Failed to connect to database: java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

Currently MySQL 8’s new default authentication is not supported by a lot of clients, so until that time, you would need to use the old mysql_native_password method.

There are many ways to change authentication method:

For reference, since Metabase from 0.32 uses MariaDB Connector/J: