Recent

Author Topic: Mysql problem connection  (Read 5957 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 443
Mysql problem connection
« on: December 07, 2021, 10:49:06 pm »
Hi i have two apps with mysql, on my computer run great, I install a mysql on computer as server one app runs with no problem but other send me error Server Connection error Failed press ok to ignored and risk corruption data, what could be problem, I put same libmysql.dll why doesn't connect...
   
mysql server 5.7.36

some body have same problem...

any help great...

thanks
Fernando Sandoval

dseligo

  • Hero Member
  • *****
  • Posts: 1177
Re: Mysql problem connection
« Reply #1 on: December 08, 2021, 01:34:47 am »
So, problem is from another computer in the network to server?
Check firewall if port 3306 is open. You also have to allow (in MySQL) access from network for username that is connecting.

I suggest you try connection with HeidiSQL https://www.heidisql.com/, and when you can connect with HeidiSQL then try your application.

In application check if you have correct HostName (IP or network address), port, username, password, maybe your antivirus is blocking your app. Check bitness of your programs: if one is 32-bit and other is 64-bit same libmysql.dll won't work.
Try to fill LibraryLocation to point to libmysql.dll.

You have to systematically check one by one issue.

And you'll have to give us more details if this won't help you.
What components are you using for mySQL connection? In ZEOS you have to set correct protocol.
What OS-es are in each computer?
« Last Edit: December 08, 2021, 01:36:21 am by dseligo »

Zvoni

  • Hero Member
  • *****
  • Posts: 2300
Re: Mysql problem connection
« Reply #2 on: December 08, 2021, 09:55:02 am »
In my.ini/my.cnf (on that server):
What's the value for Bind_address?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

eldonfsr

  • Sr. Member
  • ****
  • Posts: 443
Re: Mysql problem connection
« Reply #3 on: December 10, 2021, 04:25:14 am »
Thanks for your help, I found the problem , my mistake was Data module, I get connect using software heidsql so start dig more deep and when data module is created send me error and take the values for ip new location of data base,

on data module i change
Code: Pascal  [Select][+][-]
  1.  procedure TDM.DataModuleCreate(Sender: TObject);
  2.     begin
  3.       SQLDBLibLMysql.LibraryName:=WideString(ExtractFilePath(ParamStr(0)) + 'libmysql.dll');
  4.       SQLDBLibLMysql.LoadLibrary;
  5.  
  6.       FPXMLBServ.LoadFromFile('Setting.xml');
  7.       ServerIP:=FPXMLBServ.GetAttrValueByName('Server.ip', 'value');
  8.       serverUser:=FPXMLBServ.GetAttrValueByName('Server.user', 'value');
  9.       ServerPsw:=FPXMLBServ.GetAttrValueByName('Server.password', 'value');
  10.       ServerDb:=FPXMLBServ.GetAttrValueByName('Server.database', 'value');
  11.       if( DM.InvMgrCon.Connected= false) then begin
  12.           DM.InvMgrCon.DataBaseName := ServerDb;
  13.           DM.InvMgrCon.HostName:= ServerIp;
  14.           DM.InvMgrCon.UserName:=ServerUser;
  15.           DM.InvMgrCon.Password:=ServerPsw;
  16.      end;
  17.  
  18.      if( InvMgrCon.Connected = false) then begin
  19.          InvMgrCon.Connected:=true;
  20.       end;  
  21.  
  22.  


Thanks for your help....


 

TinyPortal © 2005-2018