Page 1 of 1

Can't connect to remote MySQL DB

Posted: 06.04.2010, 00:28
by Hippy
Hello,

sorry for a "NEWBIE"-Question!
Using ZEOS-Lib 6.6.6, Delphi 2006 I can't connect to a remote MySQL-DB. Trying to connect I get the error "SQL Error: Access denied for 'root'@'%' to database 'XYZ'. Params DataBase, HostName, Port, User and Password are correct, I can connect via MySQL Workbench 5.1 OSS (same params, of course). libmysql.dll is dated from Feb. 02. 2010. It doesn't work in IDE nor with the compiled program. Using localhost (XAMPP) works fine.
Hope anyone has an idea or a hint.
Thank you very much! (Bad English comes from Germany, sorry...)

Posted: 06.04.2010, 14:29
by bravecobra
Seems like a MySQL issue. MySQL can have multiple users with the same name, but for different hostname for its clients.
The user root@localhost is not the same as root@% or root@myhostname. The % stands for "any host".
This is setup to allow only certain clients to connect.
I'm guessing MySQL Workbench uses localhost which is usually set. Review your users in the Workbench and set passwords accordingly. You may need to add an extra user 'root' that can connect from % and has the same password as root@localhost.

Posted: 06.04.2010, 18:41
by Hippy
That's it, thanks a lot.
I didn't know that user x@localhost is different to user x@%, so I created it as you suggested and everything works fine!
Thanks again, bye
(* closed *)