简体   繁体   English

我的应用程序拒绝了MySQL Access,但其他应用程序正常运行

[英]MySQL Access denied for my application, but others work fine

I am trying to connect to my MySQL Database remotely through my application to exchange some data. 我试图通过我的应用程序远程连接到我的MySQL数据库,以交换一些数据。 It works if I compile my C# code for Ubuntu and run it locally. 如果我为Ubuntu编译我的C#代码并在本地运行它,那么它将起作用。 But when I try to run it out of Visual Studio to use the debugger, I get the error 但是,当我尝试从Visual Studio中运行它以使用调试器时,出现了错误

Access denied for user 'jackilion'@'192.168.1.110' (using password: YES)

My user jackilion has ALL privileges 我的用户jackilion具有所有特权

GRANT ALL PRIVILEGES ON *.* TO 'jackilion'@'%' IDENTIFIED BY '*****';

And furthermore, I can connect using DBeaver or other database programms using the same user and from the very same computer. 而且,我可以使用DBeaver或其他数据库程序,使用同一用户并从同一台计算机进行连接。

Soo... My code should be correct, since I can connect with it if I run it on the machine where MySQL is installed, but my MySQL settings should also be correct, since I can remotely connect from my laptop?! 太...我的代码应该是正确的,因为如果我在安装MySQL的计算机上运行它,就可以连接它,但是我的MySQL设置也应该是正确的,因为我可以从笔记本电脑进行远程连接? I am desperate, please help me. 我很拼命,请帮助我。

Thank you, Jack 谢谢杰克

EDIT My ConnectionString: 编辑我的ConnectionString:

static string ConnectionInfo =  "server=192.168.1.114;" + 
                                    "database=Data;"+
                                    "username=jackilion;"+
                                    "password=*****";

The only thing I change when running on the Ubuntu machine is changing the server address to "localhost". 在Ubuntu计算机上运行时,我唯一更改的是将服务器地址更改为“ localhost”。

Okay, I finally got it... It's a really dumb error that's completely on me. 好的,我终于明白了……这完全是我一个愚蠢的错误。 my password included the character '§', which somehow works differently when I send it to the Ubuntu machine, than when I'm using it directly on the machine. 我的密码包含字符“§”,当我将其发送到Ubuntu计算机时,它与直接在计算机上使用时有所不同。 I changed the password and it works now. 我更改了密码,现在可以使用了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WMI ConnectServer到ROOT \\ CIMV2对于C ++应用程序返回“访问被拒绝”,但对于C#应用程序工作正常 - WMI ConnectServer to ROOT\CIMV2 returns 'Access Denied' for C++ Application but works fine for C# Application 仅在一台PC上例外,在其他PC上工作正常 - Exception only in one PC, in others work fine 拒绝访问Web应用程序 - Access to the web application denied 拒绝访问应用程序池 - Access to the application pool is denied 每当我的系统一切正常后,为什么My Mysql命令在服务器上不起作用? - Why My Mysql command does not work on server whenever everything gone fine in my system? 发布桌面应用程序在我的系统上可以正常工作,但是当我将设置发送给某人时,它不起作用 - Publish desktop application working fine on my system but when I send setup to someone, it doesn't work 由于异常,无法从C#应用程序访问MySQL:“拒绝访问用户'root'@'localhost'(使用密码:YES)” - Unable to access MySQL from C# application because of Exception: “Access denied for user 'root'@'localhost' (using password: YES)” 访问C#中拒绝的目录-控制台应用程序 - Access to the directory denied in C# - Console Application Windows通用应用程序。 拒绝访问路径 - Windows universal application. Access to the path is denied 对“C:\\ ProgramData \\ Application Data”路径的访问被拒绝 - Access to the path 'C:\ProgramData\Application Data' is denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM