Delphi - ZEOS MySQL - access denied -
i trying connect mysql database server (version 5.6) on web, delphi 7 application...
with mysql workbench, works ok, can run select queries test user (the same user not working in delphi 7)...
in delphi, using tzeosconn 7.1.4-stable , typed correct hostname db server, correct username , password... (parameter loginprompt = false) when change "connected" true, working ok...
but when trying execute simple query:
zq.sql.text:='select field database.table id='+inttostr(x)+';'; zq.execsql;
where zq tzquery, , x integer,
i got error: **ezsqlexception .. select command denied @my_internet_hostname **
when logged in mysql workbench, see same user wildcard session, mydbuser@% , same select works fine
so think, problem in zeos component, adding automatically internet provider hostname...
on mysql server have wildcard hostnames allowed ( - '%' - hosts can access mysql db )
can suggest me, problem zeos component???
ps: sorry english , formatting
does mysql server internet ?
first of : internet provider allows direct access mysql database pipe/socket connexion ? internet provider don't allow because of security matters. (they can open special ip/port if ask them).
second : did have grant option ? can cause problem zeos component.
grant usage on . 'root'@'%'
grant privileges on
mydb
.* 'root'@'%' grant option
if remember well, after change privilege works. local network mysql server (with easyphp , wamp tested).
i advise connect dsn string : check below way connect :
http://synopse.info/forum/viewtopic.php?id=1547
var dsn : string; begin dsn := 'zdbc:mysql://192.168.2.60:3306/world?username=root;password=dev';
u can use zeosconnexion initialize, , careful charset used : iso-8859-1, iso-8859-15, utf-8, ansi. because delphi 7 using ansi, , internet servers use others utf-8.
anyway see error in code :
zq.sql.text:='select field database.table id='+inttostr(x)+';'; zq.execsql;
execsql used update, insert, delete commands, select command return records it's more convenient use open command :
zq.close; zq.sql.text:='select field database.table id='+inttostr(x)+';'; zq.open;
i give many path investigate, hope helps.
Comments
Post a Comment