Home Delphi - ZEOS MySQL - access denied
Reply: 0

Delphi - ZEOS MySQL - access denied

user10226
1#
user10226 Published in September 21, 2018, 8:03 am

I am trying to connect to my mysql database server (version 5.6) on the web, from Delphi 7 application...

With Mysql Workbench, it works OK, i can run select queries with my test user (the same user that not working in Delphi 7)...

In Delphi, where using TZEosConn 7.1.4-stable , typed correct hostname for DB server, correct username and password... (parameter loginprompt = false) When I change "connected" to true, everything working OK...

But when i am trying to execute a simple query:

zq.SQL.Text:='SELECT field FROM database.TABLE where id='+inttostr(x)+';'; zq.ExecSQL;

where zq is TZQuery, and x is integer,

I got this error: **EZSQLException .. SELECT Command denied for @my_internet_hostname **

When i am logged in MySQL Workbench, i see the same user with wildcard session, like mydbuser@% , the same select works fine

So i think, the problem is in ZEOS component, it adding automatically my internet provider hostname...

On the mysql server i have wildcard hostnames allowed ( simply - '%' - so all hosts can access my MYSql DB )

Can someone suggest me, what is the problem with my ZEOS component???

PS: Sorry for my english and formatting

share|improve this question
  • you can have a look at my answer here. Don't read too far only the part "permisson for a table" . The other part is not related to that.permission. Maybe it helps. – moskito-x Feb 24 '16 at 1:55
  • @moskito-x thanks for an answer, i think there is no problem with table permissions, because from my local PC (same hosname IP address, but different application) - the same thing working on mysql workbench, and unfortunately, the same thing not working in Delphi with Zeos components... Problem is, as i said, zeos component is adding "wrong" hostname after username - i.e. user@11-22-33-44.provider.com and the correct username must be user@% – Fero Feb 24 '16 at 2:03
  • there is no user@% . You always get the host where the connection comes from. – moskito-x Feb 24 '16 at 2:13
  • This is the picture from MySQL WorkBench, where everything works fine: i67.tinypic.com/11l0bkh.png – Fero Feb 24 '16 at 2:25
  • Remeber : your connection is OK . Only the user has no permission to the SELECT Command – moskito-x Feb 24 '16 at 2:25

2 Answers 2

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30839 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO