Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第一章的例子跑不通 #67

Open
keqinyang opened this issue Feb 14, 2019 · 3 comments
Open

第一章的例子跑不通 #67

keqinyang opened this issue Feb 14, 2019 · 3 comments

Comments

@keqinyang
Copy link

连接数据库失败了。

org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

The error may exist in tk/mybatis/simple/mapper/CountryMapper.xml

The error may involve tk.mybatis.simple.mapper.CountryMapper.selectAll

The error occurred while executing a query

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

@RyanOrElse
Copy link

应该是mysql-connect-java版本和你本地的mysql版本不一致导致的

@abel533
Copy link
Contributor

abel533 commented Mar 2, 2019

数据库版本多少?驱动版本多少?

@mhcn
Copy link

mhcn commented Mar 6, 2019

1.修改pom文件中mysql-connect-java的版本与数据库版本保持一致;2.mybatis-config.xml中数据库的连接地址改成localhost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants