本帖最后由 bneo-B 于 2019-5-31 13:10 编辑
1. MySQL5
1.1.在项目文件下创建lib文件夹,放入MySQL5的驱动包
1.2.鼠标右键点击`add as Library...`,图片在MySQL8里
1.3.导包 注册驱动 `Class.forName("com.mysql.jdbc.Driver")`;
1.4.获取 url :`"jdbc:mysql://localhost:3306/数据库名"`;
2. MySQL8
2.1.在项目文件下创建lib文件夹,放入MySQL8的驱动包
2.2.鼠标右键点击`add as Library...`

2.3.导包 注册驱动 `Class.forName("com.mysql.cj.jdbc.Driver")`;
2.4.获取 url :
```
url = "jdbc:mysql://localhost:3306/数据库名?useSSL=false&serverTimezone=GMT";
```
|
|