eclipse连接MySQL

时间:2018-06-10 19:54:19   收藏:0   阅读:178

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是密码

 

原文:https://www.cnblogs.com/lwpblogs/p/9164042.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!