MySQL5.0版本
DRIVER:
com.mysql.jdbc.Driver
URL:
jdbc:mysql://{ip}:{port}/{db}
注:
- 默认安装后:
– {ip} 为 localhost
– {port} 为 3306
– {db}为 你创建的数据库名
– 例如:jdbc:mysql://localhost:3306/test
MySQL8.0以上版本
DRIVER:
com.mysql.cj.jdbc.Driver
URL:
jdbc:mysql://{ip}:{port}/{db}?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
其他问题
- – The word is not correctly spelled.:
- eclipse下的Window–Preference输入spell
- 然后把第一个复选框“Enable spell checking“给去掉
- – The reference to entity “serverTimezone” must end with the ‘;’ delimiter. :
-
这个问题的原因在xml文件里是需要转义一些字符
> 替换为 > < 替换为 < " 替换为 " ' 替换为 ' & 替换为 &