0

I'm trying to create a JDBC connection between a project in Netbeans and a MySQL database. In the Netbeans connection wizard I receive the following

error: Cannot establish a connection to jdbc:mysql://localhost:3306/murach using com.mysql.jdbc.Driver (Unable to load authentication plugin 'caching_sha2_password'.)

I'm running Netbeans 8.2, MySQL 8.0.15 and Java JDK 1.8.0_201. I am able to connect to the database using the credentials supplied in the wizard via the command prompt.

I also confirmed that port 3306 is open in Windows Firewall.

shyam
  • 9,134
  • 4
  • 29
  • 44
DaveH
  • 1
  • 1
  • 2
  • see if this helps, https://stackoverflow.com/questions/24081719/connecting-mysql-server-to-netbeans – J. P Feb 11 '19 at 00:42
  • Is the error message really _"...using com.mysql.jdbc.Drive"_, or is that a typing error in your question? The driver class should be `com.mysql.jdbc.Driver` rather than `com.mysql.jdbc.Drive`. – skomisa Feb 11 '19 at 02:26
  • @skomisa Thanks for pointing that out, and after expanding the window, the full error message is: Cannot establish a connection to jdbc:mysql://localhost:3306/murach using com.mysql.jdbc.Driver (Unable to load authentication plugin 'caching_sha2_password'.) – DaveH Feb 11 '19 at 02:52
  • @DaveH Check this out -->https://stackoverflow.com/questions/50387952/how-to-resolve-unable-to-load-authentication-plugin-caching-sha2-password-issu – Swati Feb 11 '19 at 04:10
  • [1] OK, please update the question accordingly. [2] Possible duplicate of [How to resolve Unable to load authentication plugin 'caching_sha2_password' issue](https://stackoverflow.com/q/50387952/2985643). [3] The [solution given in this answer](https://stackoverflow.com/a/50433762/2985643) will probably resolve your problem. – skomisa Feb 11 '19 at 04:10
  • I was able to resolve this by downgrading to MySQL 5.7.25 – DaveH Feb 14 '19 at 05:49

1 Answers1

0

make the driver something like com.mysql5.jdbc.Driver