Mysql访问权限问题:Access denied for user 'root'@'XXX' (using password: YES)
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)的更多相关文章
- 【转载】在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码
在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码 2018年08月 ...
- 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 ...
- 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 ...
- 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 ...
- 在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码
这两天装了一个mysql 5.7数据库,但是在本地dos登陆不上去,报错Access denied for user 'root'@'localhost'(using password:YES): 也 ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...
- 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 从网上找到的解决方法,以此博客 ...
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
这两天在MyEclipse中开发Web项目时,连接MYSQL数据库,出现问题:Access denied for user 'root'@'localhost' (using password:YES ...
- Mysql相关问题-----1045 Access denied for user 'root'@'localhost' (using password: YES)报错
MySQL 连接错误,使用Navicat连接MySQL出现错误:1045 Access denied for user 'root'@'localhost' (using password: YES) ...
随机推荐
- 4种方法让SpringMVC接收多个对象(转:http://blog.csdn.net/lutinghuan/article/details/46820023)
问题背景: 我要在一个表单里同时一次性提交多名乘客的个人信息到SpringMVC,前端HTML和SpringMVC Controller里该如何处理? 第1种方法:表单提交,以字段数组接收: 第2种方 ...
- 【一天一道LeetCode】#31. Next Permutation
一天一道LeetCode系列 (一)题目 Implement next permutation, which rearranges numbers into the lexicographically ...
- 【一天一道LeetCode】#26. Remove Duplicates from Sorted Array
一天一道LeetCode系列 (一)题目 Given a sorted array, remove the duplicates in place such that each element app ...
- Leetcode_145_Binary Tree Postorder Traversal
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876769 Given a binary tree, r ...
- OC语言(一)
一.概述 1.基本上所有关键词@开头 2.字符串以@开头,如@"Hello" 3.基本数据类型 char int float double BOOL(YES\NO) 4.空为nil ...
- windows linux—unix 跨平台通信集成控制系统
首先,我们可以用到这个开源的开发包: mdk(Micro-Development-Kit)微量级软件开发包,提供几个常用类,主要实现了一个高性能的并发服务器引擎 使用c++开发,是一个跨平台的开发包, ...
- LeetCode之“排序”:Largest Number
题目链接 题目要求: Given a list of non negative integers, arrange them such that they form the largest numbe ...
- C/C++语言中NULL、'\0’和0的区别
注:本文参考了http://blog.csdn.net/mylinx/article/details/6873253及书籍<征服C指针>([日]前桥和弥著). NULL.'\0'和0的值是 ...
- "《算法导论》之‘栈’":栈的三种实现(静态数组、动态数组及指针)
本文有关栈的介绍部分参考自网站数据结构. 1. 栈 1.1 栈的定义 栈(Stack)是限制仅在表的一端进行插入和删除运算的线性表. (1)通常称插入.删除的这一端为栈顶(Top),另一端称为栈底( ...
- CIO必看:跨国集团采购部报表系统的建设经验分享
CIO必看:跨国集团采购部报表系统的建设经验分享 引言 福耀集团是国内最具规模.技术水平最高.出口量最大的汽车玻璃生产供应商,产品"FY"商标是中国汽车玻璃行业第一个"中 ...