3

I am connecting MySQL - 8.0 with Netbean and get error: Unable to load authentication plugin 'caching_sha2_password'. Any solution for this ?

DaFois
  • 2,197
  • 8
  • 26
  • 43
huy nguyen
  • 31
  • 1
  • 1
  • 3
  • nobody here can guess your code, please post it in your question – DaFois May 29 '18 at 09:14
  • not from my code, its appear when i try to connect mySQL server from netbean. I was edited my question with a picture, pls help me – huy nguyen May 30 '18 at 01:56
  • 1
    Possible duplicate of [How to resolve Unable to load authentication plugin 'caching\_sha2\_password' issue](https://stackoverflow.com/questions/50387952/how-to-resolve-unable-to-load-authentication-plugin-caching-sha2-password-issu) – Mark Rotteveel Nov 29 '18 at 16:28
  • For all looking here for answers the first one with ALTER USER worked for me, it's here https://stackoverflow.com/a/50209363/3140614 – Alcides Apr 26 '20 at 02:53

3 Answers3

2

You should use MySQL Connector/J 8.0.9 or higher.

For Windows 7:

  1. Create a new driver new driver creation
  2. Select a new MySQL Connector/J 8.0.9 or higher choosing new driver If you didn't install it during MySQL setup, you should do it first
  3. Create a new connection using new driver new connection creation
  4. Check an information, enter the password, change a value of the "zeroDateTimeBehavior" param to "CONVERT_TO_NULL", test the connection check connection If you have a "time zone" error, you should configure your MySQL time zone first
0

Try to find your my.ini (windows) or my.cnf (mac os) file and add the following line in order to change default authentication:

default_authentication_plugin=mysql_native_password 
EstevaoLuis
  • 2,422
  • 7
  • 33
  • 40
Pedro Bezanilla
  • 1,167
  • 14
  • 22
0

Do not do anything with your admin DB or user table. Here is a solution, first of all, if you have already any connection which is unable to connect, delete it. then download the drivers from this link https://jar-download.com/download-handling.php after downloading the drivers extract them and cut-paste them in the following directory. C:\Program Files\NetBeans 8.0.2\ide\modules\ext\ After doing this all, create a new connection but change the drivers with the above drivers. Now test the connection. It worked for me successfully and I hope it will work for you too.

naeem1098
  • 123
  • 2
  • 9