权限意外更改
在尝试调试我的网站时,我突然开始收到此错误:
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user 'admin'@'XXXXXXXX' (using password: YES)
它指向这些代码行:
Line 37: using (OdbcConnection con = new OdbcConnection(ConnStr))
Line 38: {
Line 39: con.Open();
我最终通过更改此代码解决了问题:
private const string ConnStr = "Driver={MySQL ODBC 3.51 Driver};"
+ "Server=xxxx.xxx;Database=xxxx;uid=xxx;pwd=xxXXxx;option=3";
从 uid=admin 更改为 uid=root。 我确信列出 root 是不好的编码习惯,但这是我所能做的让它工作。
现在问题来了。突然我的很多页面都出现了这个问题。上周他们工作得很好。现在,除非我将“admin”更改为“root”,否则它们将无法工作。我环顾四周,但我想我已经创造了自己独特的愚蠢品牌。任何帮助表示赞赏。谢谢。
While trying to debug my site, I suddenly started getting this error:
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user 'admin'@'XXXXXXXX' (using password: YES)
and it pointed to these lines of code:
Line 37: using (OdbcConnection con = new OdbcConnection(ConnStr))
Line 38: {
Line 39: con.Open();
I finally fixed the problem by changing this code:
private const string ConnStr = "Driver={MySQL ODBC 3.51 Driver};"
+ "Server=xxxx.xxx;Database=xxxx;uid=xxx;pwd=xxXXxx;option=3";
from uid=admin to uid=root.
I'm sure it's bad coding practice to list root, but it's all I can do to get it to work.
Now the issue. Suddenly a lot of my pages have this problem. Last week they were working fine. Now they won't work unless I change 'admin' to 'root'. I've looked all around, but I think I've created my own unique brand of stupidity. Any help is appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最近安装了 Windows 更新吗? (你甚至运行 Windows 吗?你在帖子中没有说)。或者有人刚刚验证/修复了您硬盘上的权限?
我的程序依赖于在 Windows 更新后以某种方式设置的权限中断。也许更新更改了某些 .NET 策略或其他内容。您的服务器可能无意中利用了刚刚(通过 Windows 更新或其他人)纠正的错误权限。
Did you recently install a Windows update? (Are you even running Windows? you don't say in your post). Or did someone just verify / repair permissions on your hard drive?
I've had programs that rely on permissions being set a certain way break after a Window update. Perhaps the update changed some .NET policy or something. It's possible your server was inadvertently taking advantage of incorrect permissions that were just corrected (by Windows Update or someone else).