Recent

Author Topic: MySQL5.7 Connection fails - Curious Error-Message  (Read 2897 times)

Zvoni

  • Sr. Member
  • ****
  • Posts: 408
MySQL5.7 Connection fails - Curious Error-Message
« on: April 04, 2018, 01:43:46 pm »
Hi Folks,

i'm looking at it, and cannot find anything wrong.
I've searched around the net but couldn't find anything (or i'm just too stupid asking Dr. Google the right Questions)

The MySQLConnect.Open throws me an error like "Cannot find "dl-error-skeleton.c"
(sorry if it's the wrong phrase, but i have german Lazarus)

Please do not answer like "Use those visual Components you have on the SQLdb-Tab", since i'm still learning the in's and out's of Pascal,
and those Components are of no use to me, if i have to code something which doesn't use an UI i can place it on

Code: Pascal  [Select][+][-]
  1. Var
  2.    MySQLConnect : TMySQL57Connection;
  3.    MySQLTrans : TSQLTransaction;
  4.    MySQLQuery : TSQLQuery;    
  5.  
  6. //Somewhere in a Procedure
  7. MySQLConnect := TMySQL57Connection.Create(nil);
  8.      MySQLTrans := TSQLTransaction.Create(MySQLConnect);
  9.      MySQLConnect.Transaction := MySQLTrans;
  10.      MySQLConnect.DatabaseName := 'mysql';
  11.      MySQLConnect.HostName:='127.0.0.1';
  12.      MySQLConnect.UserName:='root';
  13.      MySQLConnect.Password:='MySecretPassword';
  14.      MySQLConnect.Port:=3306;
  15.      Try
  16.         MySQLConnect.Open;          //KABOOM          
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

Pascal

  • Hero Member
  • *****
  • Posts: 914
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #1 on: April 04, 2018, 02:12:03 pm »
Code seems to be okay.

Do you have the correct mysql.dll in you path or app directory?

OS? Lazarus/FPC version?
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (2004)

Zvoni

  • Sr. Member
  • ****
  • Posts: 408
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #2 on: April 04, 2018, 02:19:06 pm »
OS: Ubuntu 17.10 - 64Bit
FPC 3.0.4/Laz 1.8.2

EDIT: I just downloaded this DemoMySQL-Thing from the Wiki/Sourceforge (and modified it to MySQL5.7)
and that one works
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

Zvoni

  • Sr. Member
  • ****
  • Posts: 408
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #3 on: April 04, 2018, 02:28:02 pm »
*GNARF*
You gotta be kidding me.

Moved the "uses"-line from implementation to interface, and now it's not throwing me that error.
I'll keep an eye on it.
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

Pascal

  • Hero Member
  • *****
  • Posts: 914
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #4 on: April 04, 2018, 02:58:03 pm »
Moved the "uses"-line from implementation to interface, and now it's not throwing me that error.

That shouldn't make any difference! Could this be a bug?
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (2004)

Zvoni

  • Sr. Member
  • ****
  • Posts: 408
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #5 on: April 04, 2018, 03:04:57 pm »
That shouldn't make any difference! Could this be a bug?

No Idea.
I noticed the difference with the Uses-Clause in the Demo-Project, and i just thought: What the heck? Can't hurt to try.
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

Zvoni

  • Sr. Member
  • ****
  • Posts: 408
Re: MySQL5.7 Connection fails - Curious Error-Message
« Reply #6 on: April 04, 2018, 04:31:33 pm »
And now it's back again..... >:( >:( >:( >:D >:D

EDIT: Not sure if i've figured it out, but it seems that TMySQL57Connection doesn't like Debug-Mode *confused*
« Last Edit: April 04, 2018, 06:06:04 pm by Zvoni »
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

 

TinyPortal © 2005-2018