Page 1 of 1

How to connect with Mysql database via internet?

Posted: Thu Mar 10, 2011 7:59 pm
by mol
Hi guys!
I'm still working with my billing system. Now, I want to integrate it with internet shop working on mysql database placed somewhere in internet.
I try to connect it, but it don't want to work...
I've used MySQL query manager and it works, but, I don't know how to coonect with my hmg app.
I've tried SQLMiX, but, it doesn't want to work.

DO somebody have working sample?

Bet regards, Marek

Re: How to connect with Mysql database via internet?

Posted: Fri Mar 11, 2011 4:32 am
by Rathinagiri
The easy method is using a small php script. I have done a project using this method. It works perfect for more than a year.

You can see more from here.

http://hmgforum.com/viewtopic.php?f=9&t=198

Since the connection and other data is transferred via port 80 (as http) and not 3306 (the default MySQL port), we can't connect using our usual method of connection. We have to intercept the http directly or use a PHP script to do that for us. In the above example, I have used PHP script.

Re: How to connect with Mysql database via internet?

Posted: Fri Mar 11, 2011 6:27 am
by mol
THX Rathi for your quick response!
I'll do some tests.
It's strange why MySQL Query Browser can connect to database on port 3306, but my hmg app can't.

Re: How to connect with Mysql database via internet?

Posted: Fri Mar 11, 2011 9:05 am
by Rathinagiri
Is your system acting as a server? What is the host given in MySQL Browser?

Re: How to connect with Mysql database via internet?

Posted: Sun Mar 13, 2011 2:21 pm
by mol
I have got a virtual server located in hosting company.

I'm trying to compile mysql.3 sample, but it doesn't want to comile.:
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x6f6): undefined refere
nce to `mysql_select_db@8'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x723): undefined refere
nce to `mysql_rollback@4'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x753): undefined refere
nce to `mysql_commit@4'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x783): undefined refere
nce to `mysql_close@4'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x82e): undefined refere
nce to `mysql_init@4'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x867): undefined refere
nce to `mysql_real_connect@32'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x8a4): undefined refere
nce to `mysql_close@4'
c:/hmg/harbour/lib/libhbmysql.a(mysql.o):mysql.c:(.text+0x8d3): undefined refere
nce to `mysql_get_server_version@4'
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc.exe demo.o hbmk_jb5ys2.o _temp.o -mwindows -Wl,--start-group -lhmg -lhbmy
sql -lmysql -lcrypt -ledit -leditex -lgraph -lini -lreport -lhbwin -lhbziparc -l
hbmzip -lmsvfw32 -lvfw32 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -
lhbvpdf -lhbmemio -lhbsqlit3 -lsqlite3 -lhbfimage -lhbpgsql -lpq -lhbtip -lhbct
-lhbmisc -lhbnetio -lxhb -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage
-lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -l
rddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lh
bpp -lhbcommon -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomc
tl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm
32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -odemo.exe -Lc:/hmg/ha
rbour/lib -Lc:/hmg//lib
c:\hmg\SAMPLES\MYSQL.3>

Re: How to connect with Mysql database via internet?

Posted: Sun Mar 13, 2011 4:40 pm
by Rathinagiri
It is working fine for me.

Have you ever tried to use this?

http://hmgforum.com/viewtopic.php?f=8&t=1562

Re: How to connect with Mysql database via internet?

Posted: Sun Mar 13, 2011 7:18 pm
by mol
thx Rathi, I'll try tomorrow