简体   繁体   中英

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. It works if I compile my C# code for Ubuntu and run it locally. But when I try to run it out of Visual Studio to use the debugger, I get the error

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

My user jackilion has ALL privileges

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.

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?! I am desperate, please help me.

Thank you, Jack

EDIT My 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".

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. I changed the password and it works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM