Recent

Author Topic: MySQl can't load library dll  (Read 266 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 543
MySQl can't load library dll
« on: March 10, 2025, 06:56:41 pm »
Hi i started working on app with mysql and data module, on computer where i programing run perfect so copy the app and dll library , but when run on other computer first is tried to load the app from the folder where i programing or development the app , and  i see data module when is create take all datas as was configured , so i move to not be first form on app to avoid that problem but still send me error can load library... now shoe me folder where the app is running is what i wanna....

two thinks...

1.- How i can change datas for datamodule when is the first to create on app.... to initialize all values

2.- How i can install the right dll because if is running 32 or 64 bits, as mentioned i put same dll i using on develop environment but on runing machine doesn't work..

 
Code: Pascal  [Select][+][-]
  1. procedure TDM.DataModuleCreate(Sender: TObject);
  2. begin
  3.    INI := TINIFile.Create('Server.ini');
  4.    MySQLCTrav.ClientLibrary:='';
  5. //  if t4a_Is64BitWindows then begin
  6. //    MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql32.dll';
  7. //  end  else  begin
  8. //    MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql64.dll';
  9. //  end;
  10.   if( FileExists(GetCurrentDir+'\Server.ini')) then begin
  11.      MySQLCTrav.HostName := INI.ReadString('Server','HostIp','');
  12.      MySQLCTrav.UserName := INI.ReadString('Server','User','');
  13.      MySQLCTrav.Password := INI.ReadString('Server','Password','');
  14.      MySQLCTrav.DatabaseName := INI.ReadString('Server','DatabaseName','');
  15.      MySQLCTrav.Port := INI.ReadInteger('Server','Port',3306);
  16.  end else begin
  17.     MySQLCTrav.DatabaseName:='Traveler';
  18.     MySQLCTrav.HostName:='localhost';
  19.     MySQLCTrav.UserName:='kkkk';
  20.     MySQLCTrav.Password:='9999';
  21.     MySQLCTrav.Port:=3306;
  22.     Ini.WriteString('Server','HostIp',MySQLCTrav.HostName);
  23.     Ini.WriteString('Server','User',MySQLCTrav.UserName);
  24.     Ini.WriteString('Server','Databasename',MySQLCTrav.DatabaseName);
  25.     Ini.WriteString('Server','password',MySQLCTrav.Password);
  26.     Ini.WriteInteger('Server','Port',MySQLCTrav.Port);
  27.  end;
  28.  MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql.dll';
  29.  MySQLCTrav.Connected:=true;
  30. end;
  31.  
  32.  

TRon

  • Hero Member
  • *****
  • Posts: 4329
Re: MySQl can't load library dll
« Reply #1 on: March 10, 2025, 07:45:52 pm »
Straws and grasping here.

You mentioned one single dll. Is that all that is distributed ? Are all the dependencies that the mysql library depend on present on the machine that generates the error ?

See dependency walker from M$
Today is tomorrow's yesterday.

eldonfsr

  • Hero Member
  • *****
  • Posts: 543
Re: MySQl can't load library dll
« Reply #2 on: March 10, 2025, 07:57:26 pm »
Thanks Tron well on server must be all dependency  but on client side too ...

 

TinyPortal © 2005-2018