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. ECMAScript中所有的函数的参数都是按值传递的

    看下面一段代码 function setName(obj){ obj.name='Nicholas'; obj=new Object(); obj.name="Greg"; } v ...

  2. 《java入门第一季》之Arrays类

    前面介绍了排序问题(见博客http://blog.csdn.net/qq_32059827/article/details/51362390):二分查找问题(见博客http://blog.csdn.n ...

  3. libevent之event

    就如libevent官网上所写的“libevent - an event notification library”,libevent就是一个基于事件通知机制的库,可以看出event是整个库的核心.e ...

  4. .NET(C#)连接各类数据库代码-集锦

    1.C#连接连接Access 复制代码代码如下: using System.Data;   using System.Data.OleDb;   ..   string strConnection=& ...

  5. OAF更改动态头行

    选择头信息,动态刷新行信息.本文将详细介绍该种需求的做法. 本例沿用<OAF-头行结构>的am与vo,所以在进行本例之前,请先完成<OAF-头行结构> 一.创建页面 在test ...

  6. HOW TO LINK THE TRANSACTION_SOURCE_ID TO TRANSACTION_SOURCE_TYPE_ID

    In this Document   Goal   Solution   References APPLIES TO: Oracle Inventory Management - Version 11 ...

  7. LAV Filter 源代码分析 3: LAV Video (1)

    LAV Video 是使用很广泛的DirectShow Filter.它封装了FFMPEG中的libavcodec,支持十分广泛的视频格式的解码.在这里对其源代码进行详细的分析. LAV Video ...

  8. windows下mysql免安装配置

    我下载的是mysql-5.5.20-win32.zip版本 1.解压 2.配置环境变量(让系统知道你的bin在哪个位置)path里面设置到安装目录的bin目录 3.复制一个my-huge.ini 另存 ...

  9. Oracle Global Finanicals Technical Reference(一)

    Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11 ...

  10. rails无法使用页面缓存的解决办法

    书上云在config/envirionments/development.rb中开启了缓存机制后,我们即可以使用缓存鸟:   config.action_controller.perform_cach ...