How to connect with Mysql database via internet?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

How to connect with Mysql database via internet?

Post 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
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to connect with Mysql database via internet?

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to connect with Mysql database via internet?

Post 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.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to connect with Mysql database via internet?

Post by Rathinagiri »

Is your system acting as a server? What is the host given in MySQL Browser?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to connect with Mysql database via internet?

Post 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>
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to connect with Mysql database via internet?

Post by Rathinagiri »

It is working fine for me.

Have you ever tried to use this?

http://hmgforum.com/viewtopic.php?f=8&t=1562
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply