-2

I just got back to some Java development, Got a new MAC so I had to set everything up from fresh. I downloaded NetBeans, MySQL, MySQL Drivers and everything. Set everything up.

However I just cant seem to connect to the connect through JDBC.

It keeps giving an error

Got an exception! 
Unable to load authentication plugin 'caching_sha2_password'.
BUILD SUCCESSFUL (total time: 7 seconds

A screenshot of the error.

This error is really hindering with my development process.

Thanks in advance for anyone who can help me solve this, I'm just getting started with SQL so sorry for any mistakes or whatsoever.

EDIT:- I followed a post here on SO and fixed the first problem however still unable to connect to the DB. Its now giving out a different error;

Got an exception! 
java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
user207421
  • 305,947
  • 44
  • 307
  • 483
Freakz0r
  • 53
  • 1
  • 12
  • The post [here](https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded) deals with exactly the same problem as yours on MAC OSX. – piy26 May 23 '18 at 00:48
  • Yes using the old version of password does solve the initial problem however after that, I still have errors that resist me from connecting to the DB – Freakz0r May 23 '18 at 00:56
  • If you were really unable to connect to the DB you would never have got as far as a class cast error. – user207421 May 23 '18 at 00:59
  • Connected to DB following @piy26 link. However still I'm unable to execute a simple insert JDBC statement.. – Freakz0r May 23 '18 at 01:01
  • A simple JDBC insert statement such as what? Executed by what code? Leading to what stack trace? There is presently no answerable question here. – user207421 May 23 '18 at 01:03

2 Answers2

-2

You can add the jar file in a folder within your project then locate the jars path as a library and it should work.... Just make sure your username pass and port are correct, that's how I do it on any other ide so I guess netbeans should work too

billzg
  • 3
  • 2
-2

Thanks for all your answers but I somehow got it working.

I had to do a lot of things to get it right,

  1. Import the JAR file to my project folder
  2. Flush privileges on SQL
  3. Followed this post to fix the last error Post

Thank you for all your help.

Really appreciate it.

Freakz0r
  • 53
  • 1
  • 12
  • The link you cited fixes a completely different error. I suggest you delete your question. It is of no future use to either man nor beast. – user207421 May 23 '18 at 01:21