题目详情:
Access denied for user 'root'@'HTT' (using password: YES)
办理办法:
账号暗码检查过了都是对的,就是毗连不上,后来才发现是由于没有开启远程访问的权限,如图所示:
依次输入如下三行下令:
use mysql
复制代码
update user set host = '%' where user = 'root';
复制代码
FLUSH PRIVILEGES;
复制代码
执行完以后,就毗连上了。
2.3、报错三
题目详情:
E/AndroidRuntime: FATAL EXCEPTION: Thread-2
Process: com.example.studentsystem, PID: 10636
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/sql/SQLType;
at com.mysql.cj.jdbc.ConnectionImpl.getMetaData(ConnectionImpl.java:1170)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:580)
at java.sql.DriverManager.getConnection(DriverManager.java:218)
at com.example.studentsystem.utils.JDBCUtil.getConnection(JDBCUtil.java:33)
at com.example.studentsystem.dao.UserDao.test(UserDao.java:15)
at com.example.studentsystem.MainActivity$1.run(MainActivity.java:25)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.sql.SQLType" on path: DexPathList[[dex file "/data/data/com.example.studentsystem/code_cache/.overlay/base.apk/classes4.dex", zip file "/data/app/~~43pk1avwKCpcsqDTUZz4XA==/com.example.studentsystem-57z9E8XIRruRPRJVm4fHhg==/base.apk"],nativeLibraryDirectories=[/data/app/~~43pk1avwKCpcsqDTUZz4XA==/com.example.studentsystem-57z9E8XIRruRPRJVm4fHhg==/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:637)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at com.mysql.cj.jdbc.ConnectionImpl.getMetaData(ConnectionImpl.java:1170)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:580)
at java.sql.DriverManager.getConnection(DriverManager.java:218)
at com.example.studentsystem.utils.JDBCUtil.getConnection(JDBCUtil.java:33)
at com.example.studentsystem.dao.UserDao.test(UserDao.java:15)
at com.example.studentsystem.MainActivity$1.run(MainActivity.java:25)
办理办法:
还是由于jar包驱动的题目,我这里用了8.0版本的驱动jar包,报的这个错误,后来换了5.1.49的驱动jar包就好了。
2.4、报错四
题目详情:
Public Key Retrieval is not allowed
办理办法:
在 JDBC 毗连串中加入 allowPublicKeyRetrieval=true 参数。
三、总结