For this error, RROR 1820 (HY000), is limited to the initial password situation:
Highlights of this record
1. Open the terminal, execute ./mysql -u root -p in the mysql installation directory /bin/ , prompt for a password, use the initial password when installing root to log in
2.mysql> SET PASSWORD = PASSWORD('newpass');
Query OK, 0 rows affected, 1 warning (0.00 sec)
3. After that, you can use the client jdbc to connect