MYSQL

Moderator: Rathinagiri

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

MYSQL

Post by t57042 » Tue Dec 11, 2012 12:50 pm

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: 2090
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 115 times
Been thanked: 15 times
Contact:

Post by danielmaximiliano » Tue Dec 11, 2012 12:56 pm

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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Tue Dec 11, 2012 5:23 pm

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
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Tue Dec 11, 2012 7:36 pm

No firewall

Richard

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Wed Dec 12, 2012 3:24 am

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
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Dec 12, 2012 10:09 am

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: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Wed Dec 12, 2012 11:26 am

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
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Dec 12, 2012 12:39 pm

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

thanks
Richard

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Wed Dec 12, 2012 1:00 pm

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
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Dec 12, 2012 1:31 pm

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