Page 1 of 3
MYSQL
Posted: Tue Dec 11, 2012 12:50 pm
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
Re: MYSQL
Posted: Tue Dec 11, 2012 12:56 pm
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
Re: MYSQL
Posted: Tue Dec 11, 2012 5:23 pm
by Rathinagiri
Is there firewall in between the two systems?
Re: MYSQL
Posted: Tue Dec 11, 2012 7:36 pm
by t57042
No firewall
Richard
Re: MYSQL
Posted: Wed Dec 12, 2012 3:24 am
by Rathinagiri
Can you please provide a sample?
Re: MYSQL
Posted: Wed Dec 12, 2012 10:09 am
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
Re: MYSQL
Posted: Wed Dec 12, 2012 11:26 am
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.
Re: MYSQL
Posted: Wed Dec 12, 2012 12:39 pm
by t57042
packets send=4
received = 4
lost = 0
roundtrip time in ms: min 0 - max 1 - average 0
thanks
Richard
Re: MYSQL
Posted: Wed Dec 12, 2012 1:00 pm
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?
Re: MYSQL
Posted: Wed Dec 12, 2012 1:31 pm
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