码迷,mamicode.com
首页 > 数据库 > 详细

eclipse连接MySQL

时间:2018-06-10 20:08:40      阅读:437      评论:0      收藏:0      [点我收藏+]

标签:sql数据库   机制   index   alter   color   cti   server   语句   nic   

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

标签:sql数据库   机制   index   alter   color   cti   server   语句   nic   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!