System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure. --->
System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. --->
MySql.Data.MySqlClient.MySqlException: Authentication to host '192.168.1.25' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'WIN-30UFVO1MIM' (using password: YES) --->
MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'@'WIN-30UFVO1MIM' (using password: YES)

服务器及软件环境(Mysql 5.6、windows 2008 R2 64位)。

根据这个提示按照网上通用的解决方法,修改Mysql数据库中的user表localhost为%,修改后依然无效,通过可视化工具可以用Ip连接,但是部署的.Net Web程序依然无法访问数据库,根据日志查询,错误信息如上。

大概知道是权限问题,折腾了几番后问题依旧,最后使出杀手锏重新安装Mysql!!!

解决方法:

1、彻底卸载了Mysql 5.6,重新安装,这次安装时默认端口设为3307,因3306被占用,后来把占用3306端口的mysqld进程给禁用了,端口改为3306;

2、通过mysql可视化工具进行localhost连接,正常连接;修改Web.config连接串为localhost,网页正常访问,连接串为IP则不行;

3、通过localhost进入数据库,执行SQL语句:update user set host='%' where user = 'root';

4、如果返回结果为:ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' ,则说明host已经有了%这个值;

5、再次执行SQL语句:flush privileges;

6、搞定!

注:如果以上方法依然不能解决,请查看服务器的防火墙及入站规则是否允许3306端口访问;

Mysql访问权限问题:Access denied for user 'root'@'XXX' (using password: YES)的更多相关文章

  1. 【转载】在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码

    在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码 2018年08月 ...

  2. Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes

    Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes http://blog.csdn.n ...

  3. Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE)

    安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using ...

  4. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO

    MySQL安装完server端和客户端后,登录Mysql时报错:[root@rhel204 MySQL 5.6.23-RMP]# mysqlERROR 2002 (HY000): Can't conn ...

  5. 在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码

    这两天装了一个mysql 5.7数据库,但是在本地dos登陆不上去,报错Access denied for user 'root'@'localhost'(using password:YES): 也 ...

  6. mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法

    环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...

  7. windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案

    win7 MySql5.6.17提示:1045 access denied for user 'root'@'localhost' using password yes 从网上找到的解决方法,以此博客 ...

  8. MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)

    这两天在MyEclipse中开发Web项目时,连接MYSQL数据库,出现问题:Access denied for user 'root'@'localhost' (using password:YES ...

  9. Mysql相关问题-----1045 Access denied for user 'root'@'localhost' (using password: YES)报错

    MySQL 连接错误,使用Navicat连接MySQL出现错误:1045 Access denied for user 'root'@'localhost' (using password: YES) ...

随机推荐

  1. Rust语言之HelloWorld

    Rust语言之HelloWorld 参考文档: http://doc.crates.io/guide.html 1 什么是Cargo 相当于maven/ant之于java, automake之于c, ...

  2. 【一天一道LeetCode】#20. Valid Parentheses

    一天一道LeetCode系列 (一)题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', ...

  3. Java-ServletRequestEvent-ServletRequestAttributeEvent

    /** * Events of this kind indicate lifecycle * events for a ServletRequest. * The source of the even ...

  4. Leetcode_228_Summary Ranges

    本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/46762039 Given a sorted integer ...

  5. Java中的50个关键字

    form:http://blog.csdn.net/luoweifu/article/details/6776240 Java中的50个关键字 关键字也称为保留字,是指java语言中规定了特定含义的标 ...

  6. Linux进程通信学习总结

    http://blog.csdn.net/xiaoweibeibei/article/details/6552498 SYSV子系统的相关概念   引用标识符:引用标识符是一个整数,表示每一个SYSV ...

  7. MVVM With ReactiveCocoa让移动开发更简单

    作者:@雷纯锋2011 MVVM是一种软件架构模式,它是 Martin Fowler 的 Presentation Model 的一种变体,最先由微软的架构师 John Gossman 在 2005 ...

  8. C++语言之类class

    在现实世界中,经常有属于同一类的对象.例如,你的自行车只是世界上很多自行车中的一辆.在面向对象软件中,也有很多共享相同特征的不同的对象:矩形.雇用记录.视频剪辑等.可以利用这些对象的相同特征为它们建立 ...

  9. android 应用模式之mvp

    说到MVP就不得不提到MVC,做过J2EE的猿友们肯定知道MVC是个什么东西.MVC即 Model.View.Controller, 那MVP就Model.View.Presenter.Model用于 ...

  10. obj-c编程06:反射与元编程初步

    我们知道对于现如今的动态语言比如ruby而言,反射和元编程以及支持的非常灵活了,你完全可以跳过常规的手段,而利用反射来查询或调用对象的私有方法.而obj-c对反射的支持略显小繁琐,而且在开了ARC后同 ...