课后复习
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