坑1:sql
发现经过“com.mysql.jdbc.Driver”链接不上数据库
解决:原来是8.0以上版本改成了:“com.mysql.cj.jdbc.Driver”maven
坑2:学习
java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.url
解决:将"jdbc:mysql://localhost:3306/mysql"改成"jdbc:mysql://localhost:3306/mydb?serverTimezone=UTC"插件
查看mysql的时区:3d
坑3:cdn
前两个坑经过百度就能够轻易查到,这个坑并无找到。。。
Android Studio插件:Database Navigator,特别好用,安装方式这里不赘述了,百度便可查到(貌似目前新版本中自带)
坑来了:接好!
经过如下方式建立链接:
报错:
Cannot connect to "Connection".The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
和坑2同样,但是在这里怎么解决呢?百度找不到,各类设置里也找不到。。。经过各类尝试终于:解决了!
解决以下:
划重点!划重点!划重点!
建立链接时不要选择具体数据库类型
将代码中的url填入便可!!!
附: