Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.9
-
None
Description
Trying to connect with a wrong username or password returns an SQLException which does not contain the correct expected error code (1045).
Trying with command line:
>mysql -u bar -pfoo testdb
ERROR 1045 (28000): Access denied for user 'bar'@'localhost' (using password: YES)
Using the attached test program reproduces the error:
Output MariaDB connector
MariaDB Exception: java.sql.SQLException: Could not connect: Access denied for user 'foo'@'localhost' (using password: YES)
MariaDB ErrorCode: -1
MariaDB SQLState: HY0000
Output MySQL connector
MySQL Exception: java.sql.SQLException: Access denied for user 'foo'@'localhost' (using password: YES)
MySQL ErrorCode: 1045
MySQL SQLState: 28000
-> We need this error code in order to be able to detect if a connection is setup using a wrong username or password.