MYSQL

Moderator: Rathinagiri

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

MYSQL

Post by t57042 »

I am trying out the samples about MySql.
They are working fine on the localhost.

When I try to connect from another machine (I can see the c:drive of the host from there)
I cannot connect.
What should be changed here?

Code: Select all

Private cHostName:= "192.168.1.101"  // server
//Private cHostName:= "localhost"  
Private cUser:= "root"
Private cPassWord:= ""
Private cDataBase:= "NAMEBOOK"                  
Private lLogin:= .F.  
Thanks
Richard
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: MYSQL

Post by danielmaximiliano »

I suggest you look at the example of MySQL within your installation HMG

Code: Select all

My_Abre_uma_conexao_com_MySql Function ()

               / * Check is já is connected * /
                  If oServer! = Nil, Nil Return; Endif

               / * Open MySql Conexao com * /
                  oServer: = TMySQLServer (): New (cHostName, CUser, cPassword)

               / * Check is ocorreu algum erro na Conexão * /
               If oServer: NetErr ()
                  MsgInfo ("Server Erro of Conexão com / <TMySQLServer>" + oServer: Error (), SYSTEM)
                  ALL Release Window
                  Quit
               endif

               *** Obs: a Variável oServer A Reference will semper em all or system type Operação qualquer
            
               Nil Return
C:\hmg.3.1.1\SAMPLES\MYSQL.1
C:\hmg.3.1.1\SAMPLES\MYSQL.2
C:\hmg.3.1.1\SAMPLES\MYSQL.3
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MYSQL

Post by Rathinagiri »

Is there firewall in between the two systems?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: MYSQL

Post by t57042 »

No firewall

Richard
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MYSQL

Post by Rathinagiri »

Can you please provide a sample?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: MYSQL

Post by t57042 »

I am using the demo of mysql2 in the samples.
It compiles and runs on the host.

This line: Private cHostName:= "localhost"
is replaced by this one: Private cHostName:= "192.168.1.101"

The program doesn't find the server.(error-no connection to server)
I am using MariaDB.
How can I check if my client is 'seeing' the server?
I am new to networking and MYSQL.

Thanks
Richard
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MYSQL

Post by Rathinagiri »

In the client machine, use the following command in the command prompt:

ping 192.168.1.101

Please tell me what you had got.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: MYSQL

Post by t57042 »

packets send=4
received = 4
lost = 0
roundtrip time in ms: min 0 - max 1 - average 0

thanks
Richard
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MYSQL

Post by Rathinagiri »

In that case there is nothing other than firewall would stop your MySQL connection. Please check again whether windows firewall is enabled in any of the machines. And, are you sure that MySQL is installed in the host you have provided as above?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: MYSQL

Post by t57042 »

Server on host is running - demo works on host.

Firewall on client (XP) was ON - I disabled it and restarted windows (to be sure).
On Host (W7) firewall was off.

Still no connection
Richard
Post Reply