eclipse连接MySQL

Posted lwpblogs

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了eclipse连接MySQL相关的知识,希望对你有一定的参考价值。

1.eclipse 连 mysql数据库出现错误:nknown initial character set index ‘255‘ received from server. Initial client character set can be forced via the ‘characterEncoding‘ property.

解决方法:String url = "jdbc:mysql://localhost:3306/jdbcStudy?useUnicode=true&characterEncoding=utf8";

 

2.访问报错com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client

解决方法:

执行语句修改

 

mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘66666‘;

 

Query OK, 0 rows affected (0.11 sec)
mysql> FLUSH PRIVILEGES;

 

Query OK, 0 rows affected (0.01 sec)

 

注意:root是用户名,localhost是特指本机,mysql_native_password是旧的密码验证机制,66666是密码

 


以上是关于eclipse连接MySQL的主要内容,如果未能解决你的问题,请参考以下文章

mysql和eclipse已经连接上但是没有创建表回出现异常吗?

eclipse怎么连接mysql数据库

如何用Eclipse连接MySQL数据库

eclipse 连接 mysql

eclipse连接MySQL

通过eclipse连接mysql数据库