JDBC 连接 MySQL 8.0.15+ 常见错误记录
课后复习
1. No suitable driver found for mysql:jdbc://localhost:3306/test
错误原因:
mysql:jdbc://localhost:3306/test
jdbc:mysql://localhost:3306/test
2. Not allowed to connect to this MySQL server:
错误原因:
jdbc:mysql://192.168.3.20:3306/test
这个设置默认是没有权限的,需要授权
- 使用root账号查询权限:
SELECT USER, HOST FROM mysql.user WHERE USER=‘root‘;
- 授权
GRANT ALL PRIVILEGES ON test.* TO ‘root‘@‘192.168.3.20‘ IDENTIFIED BY ‘密码‘; flush privileges;
3. The server time zone value ‘?й???????‘ is unrecognized
jdbc:mysql://192.168.3.20:3306/test // 更改为 jdbc:mysql://192.168.3.20:3306/test?serverTimezone=UTC
相关推荐
Andrea0 2020-09-18
ASoc 2020-11-14
Cherishyuu 2020-08-19
dongtiandeyu 2020-08-18
CoderYYN 2020-08-16
大黑牛 2020-08-15
Dullonjiang 2020-08-11
gaozhennan 2020-08-03
mcvsyy 2020-08-02
zbcaicai 2020-07-29
AscaryBird 2020-07-27
liulin0 2020-07-26
ldcwang 2020-07-26
helloxusir 2020-07-25
娜娜 2020-07-20
pengpengflyjhp 2020-07-19
点滴技术生活 2020-07-19
人可 2020-07-18
chenjiazhu 2020-07-08