Recent

Author Topic: [SOLVED] Lazarus0.9.30.2 / MySQL5.5.13 / TMySQL50Connection error. How to solve?  (Read 6877 times)

lazguy

  • Jr. Member
  • **
  • Posts: 75
Hello Everybody, I'm back with another problem. Please, anyone can help me ?

I started to develop an application with Lazarus 0.9.30 with MySQL 5.5.13 and TMySQL50Connection (created dynamically, not placed on any form). Everything is Ok. No troubles.

Today I uninstalled this (old) version of Lazarus and Installed Lazarus 0.9.30.2 and I have made a reinstallation of the components that is not shipped with Lazarus like PowerPDF and others.

When I run the software (without any modifications, just like the way it was on Lazarus Previous version) and attempt to call the open method of the TMySQL50Connection I'm getting the following error message:

Debugger Exception Notification Project Controle de Processos raised exception class 'EInOutError' with message: TMySQL50Connection can not work with the installed MySQL client version: Expected (5.0), got (5.1.45).

I am developping in a Windows 7 Machine. The software is running on Windows XP, Vista and 7.

What can I do to solve this ?  Back to previous version of Lazarus ? Is there any Patch for this problem ? Can I use this component from the previous version of Lazarus in the new Lazarus Version ?

Please Help Me !!!!!!!!!!!

Thank you very much in advance.
« Last Edit: February 08, 2012, 02:38:03 am by lazguy »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 0.9.30.2 / MySQL 5.5.13 / TMySQL50Connection error. How to solve ?
« Reply #1 on: February 01, 2012, 10:22:07 pm »
Not an expert but I suspect the mysql client dll in your Lazarus directory, windows/system directory, or application directory is version 5.1.45, not 5.0... I'd check that and replace with the 5.0 version if not...
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

lazguy

  • Jr. Member
  • **
  • Posts: 75
Re: Lazarus 0.9.30.2 / MySQL 5.5.13 / TMySQL50Connection error. How to solve ?
« Reply #2 on: February 02, 2012, 01:35:14 pm »
Hi BigChimp, Thank you for your reply !!

Well, I was using everything without any problems. I only upgraded Lazarus. I did nothing with MySQL. Maybe the problem is only with TMySQL50Connection.

Thank you BigChimp, but for me your answer don't make sense. Am I wrong ?

Who can help me ?

Thank you very much in advance.

Mario13

  • New member
  • *
  • Posts: 5
Re: Lazarus 0.9.30.2 / MySQL 5.5.13 / TMySQL50Connection error. How to solve ?
« Reply #3 on: February 02, 2012, 01:39:54 pm »
In Lazarus 0.9.30.2 the TMySQL51Connection doesn't appears in the palette. To enable it, modify the file components/sqldb/registersqldb.pas, replacing in the line 28   {$IFDEF VER2_5_1}  with {$IF FPC_FULLVERSION> 20402}. After that, recompile the IDE from the menu options. This change was taken from 0.9.31, and i believe it should also be included in 0.9.30.3 trunk.

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Lazarus 0.9.30.2 / MySQL 5.5.13 / TMySQL50Connection error. How to solve ?
« Reply #4 on: February 02, 2012, 01:42:41 pm »
Use  TMySQL51Connection instead of TMySQL50Connection.
The easiest is to edit your .lfm and .pas files and change 50 for 51. Editing lfm files in lazarus is tricky. It works if you close the unit after opening the form as .lfm. Editing the .lfm while the unit is open doesn't update the form and it keeps reverting to the old one when saving.
You can also use an external editor to make these changes as long as the units are not opened in lazarus.

Quote
Well, I was using everything without any problems. I only upgraded Lazarus.
Don't know if your old lazarus had a TMySQL51Connection. If not, TMySQL50Connection wasn't aware of the next version yet and would accept everything that was 5.0 or greater. Todays TMySQL51Connection will accept a mysql5.5 library until TMySQL55Connection will be created. From then on TMySQL51Connection will refuse to work with 5.5.

lazguy

  • Jr. Member
  • **
  • Posts: 75
Re: Lazarus 0.9.30.2 / MySQL 5.5.13 / TMySQL50Connection error. How to solve ?
« Reply #5 on: February 03, 2012, 01:55:49 am »
Thank you very very much, ludob !!!!!!

I replaced in my code all occurrences of TMySQL50Connection to TMySQL51Connection and it works !!!!

Problem solved.

lefti2003

  • New Member
  • *
  • Posts: 22
I have the latest lazarus 9.30.4 and fpc 2.6.0 as of 03-14-12. I do not see the MySQL51Connection in the palette. I instead placed a MYSQL50Connection and modified all occurrences of MySQL50Connection with MySQL51Connection but get an error saying identifier not found "TMySQL51Connection". Shouldnt the latest lazarus have this component. I know another person mentioned to go to components/sqldb and edit the registerssqldb file. Is this still the only way even with the latest lazarus. Thanks

Lefti