[error] xx is not allowed to connect to this MySQL Server

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
maxchenjun
Posts: 8
Joined: Tue 13 Nov 2007 10:26

[error] xx is not allowed to connect to this MySQL Server

Post by maxchenjun » Tue 13 Nov 2007 12:12

Delphi 7
MyDAC 5.20.0.11 Trial Version
MySQL 5.0.24

Where xx is the name of my computer. I install the mysql server in the same computer as the application runs. If I set the server for TMyConnection as 'localhost' it works. But if I changed this to the ip address of the computer. It reports error: 'xx is not allowed to connect to this MySQL Server'.

Has anyone any ideas for me? THX in advance !

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 15 Nov 2007 09:31

If you need to connect to MySQL using 'localhost' in your connection settings, you need permissions for 'user_name'@'localhost'. But when you connect to the same server from the same application using the name of your computer, you need permissions for 'user_name'@'your_computer_name'. So you need to grant privileges for the 'user_name'@'your_computer_name' user to use your computer name in the connection settings.

Post Reply