MySQL errors: Unable to load authentication plugin 'caching_sha2_password'.

Discussion in 'Plugin Development' started by Civiled, Jan 3, 2019.

  1. Offline


    Hello, I am trying to establish a connection to a database that is initiated only when the server runs. I do this with a tool called 'DbLib'. useSSL must be false with DbLib so I did so in the connection url. The problem is, now I get the error 'MySQL errors: Unable to load authentication plugin 'caching_sha2_password'.' I need a way to fix this within the code because you cannot access the console on most of the servers this will be on due to the fact that it is purely Minecraft Hosting. Here are some links you may find helpful:

    Other answer I found but I have no clue how to execute this:

    DbLib Github:

    And here is my code that I use to connect:
    DriverManager.getConnection("jdbc:mysql://" + this.hostname + ':' + this.port + '/' + this.database + "?useSSL=false", this.user, this.password);
    Any suggestions??
    Last edited by a moderator: Jan 3, 2019

Share This Page