[英]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.