Can't connect to remote MySQL DB

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Hippy
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.01.2010, 00:30

Can't connect to remote MySQL DB

Post 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...)
bravecobra
Junior Boarder
Junior Boarder
Posts: 29
Joined: 31.10.2005, 00:09
Location: Antwerp
Contact:

Post 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.
Brave Cobra
bravecobra.com
Hippy
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.01.2010, 00:30

Post 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 *)
Post Reply