mysql Access denied for user 'root'@'localhost' (using password: YES)
【现象说明】
C/S程序远程訪问正常,本地訪问报下面异常
MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: YES) ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user 'root'@'localhost' (using password: YES)
配置文件例如以下:
<add name="RemoteConnString" connectionString="Database='mealbooker';Data Source='localhost';User Id='root';Password='123456';charset='gb2312';pooling=true" providerName="MySql.Data.MySqlClient"/>
【分析】
权限问题吧,查看下mysql数据库中的user表
发现localhost以下值为空,于是connection string中的localhost 改为 127.0.0.1。測试通过~~~
【解决】
配置文件里改为localhost,訪问数据库正常;同一时候mysql command line工具输入password后一闪而过问题同一时候解决。
重新启动之后又訪问不了,继续上面的思路改动:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpbmV5Y2g=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
另,mysql command line工具一闪而过,方法參见这里
还有一个权限相关问题:
Error Code: 1370 execute command denied to user 'root'@'localhost' for routine
使用grant execute on procedure/function dbname.fname TO 'root'@'localhost';
还有一password相关问题(调试机放几天后就没法远程訪问了,rootpassword被修改,不明原因):
Authentication to host '10.10.123.6' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'10.10.123.5' (using password: YES) ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user
'root'@'10.10.123.5' (using password: YES)
改动password语句例如以下:
然后还要给远程用户非配权限
grant all privileges on *.* to 'root'@'%' with
grant option;
mysql Access denied for user 'root'@'localhost' (using password: YES)的更多相关文章
- mysql Access denied for user root@localhost错误解决方法总结(转)
mysql Access denied for user root@localhost错误解决方法总结(转) mysql Access denied for user \'root\'@\'local ...
- MySQL Access denied for user root@localhost 解决方法
今天把本地开发的项目(ThinkPHP 3.2.3)移到虚拟机上(CentOS 6.6,LNMP 1.2,MySQL 5.6.23),配置好 MySQL 之后访问首页,出现: 此时 MySQL 的用户 ...
- 解决mysql“Access denied for user 'root'@'localhost'”
解决mysql“Access denied for user 'root'@'localhost'” 分类: linux 2011-01-14 00:23 147547人阅读 评论(3) 收藏 举报 ...
- mysql Access denied for user \'root\'@\'localhost\'”解决办法总结,下面我们对常见的出现的一些错误代码进行分析并给出解决办法,有需要的朋友可参考一下。
mysql Access denied for user \'root\'@\'localhost\'”解决办法总结,下面我们对常见的出现的一些错误代码进行分析并给出解决办法,有需要的朋友可参考一下. ...
- MySql access denied for user错误
MySql access denied for user错误 | 浏览:2812 | 更新:2014-11-27 11:16 MySql access denied for user错误 方法/步骤 ...
- 我用工具怎么连接不上mysql数据库的? MySql access denied for user错误
MySql access denied for user错误 方法/步骤 MySql远程连接时的"access denied for user **@**"错误,搞的我很头大, ...
- MySql Access denied for user 'root'@'localhost' (using password:YES) 解决方案
关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入"mysql -uroot -pmyadmin"后出现以下错 ...
- mysql Access denied for user root @localhost (using password:YES)错误
C:\AppServ\MySQL> mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'r ...
- mysql Access denied for user root@localhost错误解决方法总结
原文:http://www.111cn.net/database/mysql/44142.htm Access denied for user 'root'@'localhost' (using pa ...
随机推荐
- php简单表格函数
php简单表格函数 代码 <?php //ctrl+shift+j /** * @param unknown $rows * @param unknown $cols * @param stri ...
- Softmax回归——logistic回归模型在多分类问题上的推广
Softmax回归 Contents [hide] 1 简介 2 代价函数 3 Softmax回归模型参数化的特点 4 权重衰减 5 Softmax回归与Logistic 回归的关系 6 Softma ...
- [CQOI 2007] 涂色
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1260 [算法] 区间DP [代码] #include<bits/stdc++. ...
- thymeleaf 引入js css 无效
转自:https://blog.csdn.net/qq_33833327/article/details/81388502
- 排序系列 之 希尔排序算法 —— Java实现
基本思想: 希尔排序的实质就是分组插入排序,又称缩小增量法. 将整个无序序列分割成若干个子序列(由相隔某个“增量”的元素组成的)分别进行直接插入排序,然后依次缩减增量再进行排序,待整个序列中的元素基本 ...
- vue项目中阻止浏览器返回上一页
vue项目中在某个页面阻止浏览器返回上一页,适用移动端.PC端. 使用场景例如: 首页 与 A页面 来回跳转,那样点击浏览器返回时也会来回跳转,本想当页面在首页的时候就不再返回了,所以这个时候 ...
- 3.TinkPHP中的模型
1.配置数据库的连接设置 数据库的连接配置项可以在系统的主配置文件中 2.什么是模型? 模型是MVC 三大组成部分的M,作用是负责与数据表达额交互(CRUD) 3.模型的创建 命名规范:不带前缀的标明 ...
- Android应用优化之代码检测优化
在网络层,互联网提供所有应用程序都要使用的两种类型的服务,尽管目前理解这些服务的细节并不重要,但在所有TCP/IP概述中,都不能忽略他们: 无连接分组交付服务(Connectionless Packe ...
- Linux od与hexdump命令
od命令:以指定格式输出文件内容常用格式:od -Ax -tx1 filename直接格式:od filename 等价 od -o filename语法:od [-abcdfsiloxv] [-An ...
- CSS3 动画 思维导图
思维导图在新窗口打开浏览