Recent

Author Topic: Error in MySQL connectiom  (Read 472 times)

CarlLanco

  • New member
  • *
  • Posts: 6
Error in MySQL connectiom
« on: April 16, 2021, 09:51:13 pm »
I tried to connect a program with a data base in a external server.
When i test the connection in the objet inspector, it work fine (after several days of work), but when I run the program, the connecction fail and this message pop-up.:"DBConnecction : Server connection failed .".

 I use w10 64 bits
What can be wrong??

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1109
    • Burdjia
Re: Error in MySQL connectiom
« Reply #1 on: April 18, 2021, 12:06:03 pm »
Without a sample code it is hard to know...
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Zvoni

  • Hero Member
  • *****
  • Posts: 550
Re: Error in MySQL connectiom
« Reply #2 on: April 19, 2021, 08:41:34 am »
Well, the first two "classic" suspects are
1) The BindAddress-Parameter in the my.cnf/my.ini causing the server to listen to localhost only
2) the used "user" not being allowed external access a.k.a 'bob'@'localhost' instead 'bob'@'%'
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

dseligo

  • Full Member
  • ***
  • Posts: 242
Re: Error in MySQL connectiom
« Reply #3 on: April 19, 2021, 10:41:52 am »
I assume you run program from same computer you are able to connect from Object inspector?
Do you have any code in your program that changes properties of DBConnection? Or you just set 'DBConnection.Connected:=True;' in your program?
Try to disable firewall temporarily and see if that helps.

dseligo

  • Full Member
  • ***
  • Posts: 242
Re: Error in MySQL connectiom
« Reply #4 on: April 19, 2021, 10:45:43 am »
Well, the first two "classic" suspects are
1) The BindAddress-Parameter in the my.cnf/my.ini causing the server to listen to localhost only
2) the used "user" not being allowed external access a.k.a 'bob'@'localhost' instead 'bob'@'%'
If he can connect from OI on the same computer then 1) is not the case. And he said he connects to remote computer, so this one should be OK.
Same goes for 2), and I think he would get another error (something like 'user bob is not allowed...').

Zvoni

  • Hero Member
  • *****
  • Posts: 550
Re: Error in MySQL connectiom
« Reply #5 on: April 19, 2021, 11:08:44 am »
He has not specified, if the dev_MySQL-Server is the same as the one he tries to run the program against.

Think about it: when you're developing a frontend for a MySQL-Database, do you really have a dedicated machine somewhere?

OH, and there is a reason why i never set the connection-properties in the OI.....
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

dseligo

  • Full Member
  • ***
  • Posts: 242
Re: Error in MySQL connectiom
« Reply #6 on: April 19, 2021, 11:33:55 am »
He has not specified, if the dev_MySQL-Server is the same as the one he tries to run the program against.

Think about it: when you're developing a frontend for a MySQL-Database, do you really have a dedicated machine somewhere?

OH, and there is a reason why i never set the connection-properties in the OI.....
That's the reason I asked him: 'Do you have any code in your program that changes properties of DBConnection?'

 

TinyPortal © 2005-2018