Recent

Author Topic: Lazarus 9.30.2-2 and MySQL 5.5.24  (Read 15939 times)

guest48180

  • Guest
Lazarus 9.30.2-2 and MySQL 5.5.24
« on: August 23, 2012, 09:28:55 pm »
Okay. I have MySQL installed and have created a db using the terminal. It's called employees. I have setup a table with a couple entries in it. I have worked with it in the term so I know it's there. But when I place a MySQL50Connection1 on my form and try to set the properties, all is good until I try to set the Connected feature on Lazarus to True. I get the following error msg:

Can not load default MySQL library ("libmysqlclient.so.15" or "libmysqlclient.so"). Check your installation.

I know the installation is good (or at least I think it is) because I created a database and have manipulated it from within the term. So why is it that I get this error when I try to Connect to the db in Lazarus? Is Lazarus trying to find these files in a different directory than the one it installed in? I watch all the online tutorials. I have read this and I've read that. But when it comes to trying to making it work in Lazarus...I haven't a clue. Has anyone faced the same as me? Or am I just a lost cause for doing what others seem to be able to do? Any insight here would be appreciated. Any at all. Thanks.

ezlage

  • Guest
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #1 on: August 23, 2012, 10:48:29 pm »
Install the MYSQL Client.

In OpenSUSE:

zypper install mysql-client

ezlage

  • Guest
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #2 on: August 23, 2012, 10:53:02 pm »
If is installed, find the file at disk, make a symbolic link at project path to the libmysql.so.

Sorry by my poor english.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #3 on: August 24, 2012, 08:13:47 am »
What ezlage said. Probably FPC/Lazarus is looking for the wrong library name.

Fixes for this have just been committed to current FPC code, but that of course won't help you as you have older code.

AFAIR, there is also a way to specify in your program exactly what mysql filename to load, but haven't used that...

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

dokhebi

  • New Member
  • *
  • Posts: 24
  • SysAdm, DBA, Programmer, SF/F Fan, Uber Whovian!
    • Ogre Musings
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #4 on: December 07, 2012, 07:03:55 pm »
I have the required library, but Lazarus can't find it.  How do I alter the library path so Lazarus *can* find it?  I've already altered the library path in Project Options -> Compiler Options -> Paths  but this doesn't seem to help.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #5 on: December 07, 2012, 07:14:23 pm »
That only helps for Pascal source code, not for compiled shared library dlls/so/dylib.

Please post your Lazarus version, operating system version etc when asking a question.

Also, please refer to the mysql page on the lazarus wiki and other instructions: make sure the mysql library version matches the connector; on Linux you may have to create a symlink or install the -dev package etc.
This stuff has been covered lots of times; please help others help you by doing a bit of research and specifying some details.
Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

dokhebi

  • New Member
  • *
  • Posts: 24
  • SysAdm, DBA, Programmer, SF/F Fan, Uber Whovian!
    • Ogre Musings
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #6 on: December 07, 2012, 07:59:18 pm »
WinXP Pro
Lazarus 1.0.2
MySQL 5.5.27 (installed with XAMPP 3.1.0)
FPC (whatever version comes with L 1.0.2)

I've looked at the lazarus wiki and it mentioned to place it project output directory, is that the same as the project source files directory?  I can't see any references to "Project Output Directory" in the project options.

I placed the library with the project files and it still can't be found.  What next?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #7 on: December 07, 2012, 08:09:27 pm »
Thanks. Laz 1.0.x comes with FPC 2.6.0

The project output directory is where your exe file will be placed. That can be different from the source files. If it is different and the dll is not there, your program won't work (and you'll get an error when debugging the program in the IDE).

Are you sure you copied all required dlls (if there's more than one, haven't used mysql on Windows for a while)? Does the dll match bitness with your project (i.e. 32 bit dll with 32 bit applications; 64 bit applications with 64 bit dll).

So you're using the TMysql55connector, right?

Next up could be using sysinternals process monitor to follow the compiled application and see what dlls it tries to load... or wait for somebody who really uses mysql to chip in & help.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BlueIcaro

  • Hero Member
  • *****
  • Posts: 792
    • Blog personal
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #8 on: December 07, 2012, 09:00:32 pm »
Why don't you use the lastes oficial release 1.04?
I think since 1.x version solved a lot of bugs/problems and it was a big jump in Lazarus.
/BlueIcaro

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #9 on: December 07, 2012, 09:01:21 pm »
If you use a version of mysqlclient that needs additional libraries (libc,iconv,SSL), those need to be placed there too. Try to put all dlls of the mysql dir in the directory with the EXE.

If it then works, you can try to reduce the set again till you find the minimal set.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #10 on: December 07, 2012, 09:03:15 pm »
Hmm, think about it, even 2.6.0 doesn't have a 5.5 connector. Must have 2.6.2rc1 probably

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #11 on: December 07, 2012, 09:13:26 pm »
Hmm, think about it, even 2.6.0 doesn't have a 5.5 connector. Must have 2.6.2rc1 probably
;)

You're right:
http://wiki.lazarus.freepascal.org/SQLdb_Package#TXXXConnection
... since 2.6.1/2.6.2RC1...

Does take away the suspense of waiting for the poster's answer to my question:
Quote
So you're using the TMysql55connector, right?
... even though I should've known that connector is not available ;)

@dokhebi: just to reiterate:
http://wiki.lazarus.freepascal.org/mysql#SQLDB
Quote
Make sure you are using the correct connection component for your client library version. So if you have the client libraries installed for MySQL 4.1 then you have to use TMySQL41Connection component, even if the server is running version 4.0 or 5.0
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #12 on: December 07, 2012, 09:14:13 pm »
If you use a version of mysqlclient that needs additional libraries (libc,iconv,SSL), those need to be placed there too. Try to put all dlls of the mysql dir in the directory with the EXE.
Ehm yes, as I said in an earlier post ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

dokhebi

  • New Member
  • *
  • Posts: 24
  • SysAdm, DBA, Programmer, SF/F Fan, Uber Whovian!
    • Ogre Musings
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #13 on: December 07, 2012, 10:08:25 pm »
I put libmysql.dll in c:\Windows\System32 and it found it...  But now it says it's the wrong version.  I was expecting that when I saw that there *is* a component for MySQL 5.5 (somewhere).  I had a fleeting thought that the 5.1 component would work since I downloaded Lazarus 1.0.2 last month (it was the current version at the time) and MySQL 5.5 has been out for some time.

I have downloaded Laz 1.0.4 an will install in a moment but I want to ask, are there any plans to add an update feature to Lazarus so it will look for pieces that have changed, then download and install them?

Thanks!

dokhebi

  • New Member
  • *
  • Posts: 24
  • SysAdm, DBA, Programmer, SF/F Fan, Uber Whovian!
    • Ogre Musings
Re: Lazarus 9.30.2-2 and MySQL 5.5.24
« Reply #14 on: December 07, 2012, 10:33:50 pm »
Lazarus 1.0.4 does not have TMySQL55Connect.  Where do I get this component?

 

TinyPortal © 2005-2018