首页 / MYSQL / 【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons
【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3667字,纯文字阅读大概需要6分钟。
内容图文
![【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons](/upload/InfoBanner/zyjiaocheng/922/590d4d1ef10d4860afc2737caa4e90c4.jpg)
报错缘由:
起初在验证一个mybatis的demo时提示“Error querying database”(见下方完整代码),找了很多方法没有解决,最后在贴吧找到答案。错误原因是安装mysql时Authentication Method选择了第一种强加密方法,改成第二种问题就解决了。
解决方法:
- 打开mysql安装程序(或者重装,但是重装很麻烦),重新配置MySQL Server
- 配置Authentication Method这一步时,选择第二种加密方法,重新打开Navicat,问题解决。
参考资料: 贴吧13楼答案:http://tieba.baidu.com/p/5658058140
完整错误代码:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client ### The error may exist in com/how2java/pojo/Category.xml ### The error may involve com.how2java.pojo.listCategory ### The error occurred while executing a query ### Cause: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:136) at com.how2java.TestMybatis.main(TestMybatis.java:22) Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775) at com.mysql.jdbc.Connection.<init>(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:201) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:196) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:93) at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:385) at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:89) at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:138) at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:60) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ... 3 more Process finished with exit code 1
内容总结
以上是互联网集市为您收集整理的【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons全部内容,希望文章能够帮你解决【已解决】使用Navicat连接MySQL数据库时报错Client does not support authentication protocol requested by server; cons所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。