Recent

Author Topic: How to connect to MySQL 5.1.30?  (Read 25209 times)

Brent

  • Newbie
  • Posts: 1
How to connect to MySQL 5.1.30?
« on: October 29, 2009, 05:14:04 pm »
I just downloaded FreePascal yesterday and Lazarus this morning so I'm on a roll here. javascript:void(0);

I have an existing MySQL 5.1 database that I'd like to connect to but the TmySQL50Connection component complains "TMySQL50Connection can not work with the installed MySQL client version (5.1.30)".

Why not? MySQL 5.1 SQL is virtually identical to 5.0. How can I get this to connect?
Pls explain in detail because I'm an old Delphi programmer and I'm green as a cucumber when it comes to FP & Lazaraus.javascript:void(0);

Brent

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: How to connect to MySQL 5.1.30?
« Reply #1 on: October 29, 2009, 06:52:36 pm »

If it is not bothering you, you can try with the 5.0.84 (old version), it works without problem.
Another idea is can you look and try with the zeos components may be they had overcome this problem.
Thanks.

bluewolf

  • New Member
  • *
  • Posts: 24
Re: How to connect to MySQL 5.1.30?
« Reply #2 on: October 29, 2009, 07:21:15 pm »
Hi Brent,

Connection to MySql 5.1 has been already commented in this thread.

Currently TMySQL50Connection does not support MySql 5.1.
However Zeoslib is working fine under Lazarus and with MySql 5.1. I have personally tried it and I was able to use MySql 5.1 without problems.
Alberto

reneve59

  • New Member
  • *
  • Posts: 23
Re: How to connect to MySQL 5.1.30?
« Reply #3 on: January 05, 2010, 02:38:33 am »
Hi bluewolf I'm migrating a C++ Builder / MySQL 5.1 application to Lazarus, it is very similar interface and had no trouble with this task until I faced the interaction with MySQL. I've been browsing the internet looking for documentation on how to connect  to MySQL server with standard component TMySQL50Connection with no luck, finally i found that it does not support MySQL 5.1.xx, now I want to try ZeosLib,  so could you please post some of your code on how to use ZeosLib components?

Regards



jmLandsvik

  • New Member
  • *
  • Posts: 29
Re: How to connect to MySQL 5.1.30?
« Reply #4 on: April 11, 2011, 01:09:59 pm »
Hi Brent,

Connection to MySql 5.1 has been already commented in this thread.

Currently TMySQL50Connection does not support MySql 5.1.
However Zeoslib is working fine under Lazarus and with MySql 5.1. I have personally tried it and I was able to use MySql 5.1 without problems.


Have mad a remark where your link points bluewolf.

I started tracing the code for SQLdb, and actually found references to MySQLVersion = '5.1'

So, now that we are in 2011, and laz./fpc = .9.30/2.4.2, why is this still NOT working ?
I mean, take it OUT then, nothing is more frustrating that having components at your disposal that's not working properly.

regz...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2496
Re: How to connect to MySQL 5.1.30?
« Reply #5 on: April 11, 2011, 04:45:55 pm »
So, now that we are in 2011, and laz./fpc = .9.30/2.4.2, why is this still NOT working ?
I mean, take it OUT then, nothing is more frustrating that having components at your disposal that's not working properly.

TMySQL50Connection is for connecting to MySQL 5.0 databases, so it will never taken out.

Due to the API changes of every point/minor release of MySQL, a TMySQL51Connection (if existed) won't work with a 5.0 client.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Lacak2

  • Guest
Re: How to connect to MySQL 5.1.30?
« Reply #6 on: April 12, 2011, 07:29:31 am »
I work with FPC 2.5.1 and there is alreday TMySQL51Connection component. May be, that this was not backported to FPC 2.4.2 ?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7641
Re: How to connect to MySQL 5.1.30?
« Reply #7 on: April 12, 2011, 10:28:02 am »
I work with FPC 2.5.1 and there is alreday TMySQL51Connection component. May be, that this was not backported to FPC 2.4.2 ?

Lacak2:
See my response in this thread: http://lazarus.freepascal.org/index.php/topic,9971.0.html

MarcW: 5.1 is compatible. The trouble however is that you can't know this beforehand with MySQL, and their version numbers don't help either.
So we can't enable future versions till we have enough user feedback that we know they are compatible (or deal with spurious bugreports).

You can also see the dilemma here, either way we get trouble (not compatible->crashes and spuroious bugreports, compatible-> not prepared and have to inform heaps of people to create symlinks).

So in short, most of the DB people recommend you avoid mysql if you can. I know you can't always, but at least try.  Both Interbase/Firebird and PostgresSQL are the logical choices.

Currently, MySQL 5.5 is the next accident waiting to happen.

Lacak2

  • Guest
Re: How to connect to MySQL 5.1.30?
« Reply #8 on: April 13, 2011, 03:23:57 pm »
Currently, MySQL 5.5 is the next accident waiting to happen.

Yes and then 5.6 and then 6.0
I would prefer some generic solution, where client library version is obtained from client library (mysql_get_client_info) and based on retrieved value will behave
and/or introduce property in TMySQLConnection like Version (v50,v51,v55,v56,v60) ...
but I do not know if there are some side implications

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2496
Re: How to connect to MySQL 5.1.30?
« Reply #9 on: April 13, 2011, 05:14:07 pm »
Yes and then 5.6 and then 6.0
I would prefer some generic solution, where client library version is obtained from client library (mysql_get_client_info) and based on retrieved value will behave
and/or introduce property in TMySQLConnection like Version (v50,v51,v55,v56,v60) ...
but I do not know if there are some side implications

That won't work. The problem is that the MySQL team in the past managed to change headers which were incompatible with previous versions. They once even changed the order of an enum.
So having some client info won't guarantee if records have the same layout, constants have the same value etc. That's why we cannot predict if a version 5.6 will work.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7641
Re: How to connect to MySQL 5.1.30?
« Reply #10 on: April 13, 2011, 10:29:30 pm »
Currently, MySQL 5.5 is the next accident waiting to happen.

Yes and then 5.6 and then 6.0
I would prefer some generic solution, where client library version is obtained from client library (mysql_get_client_info)

Possible.

Quote
and based on retrieved value will behave

Impossible. The whole problem is that a sane prediction about Mysql compatibility can't be derived from the version number.
 

PaulANormanNZ

  • Jr. Member
  • **
  • Posts: 93
Re: How to connect to MySQL 5.1.30?
« Reply #11 on: April 21, 2011, 08:50:43 am »
HI,

Should I expect this is why I can not connect through Zeos using ZConnection setting mysql-5

Nor with SQLdb TMySQL50Connection

PhpInfo reports my local XAMPP as mysqlnd 5.0.7-dev - 091210

(When I try to set either Query component to Active:=True; everything just freezes.)

If I decide to go-back my MySql installation, or Update it, what are the best MySql versions to aim for to get compatability with Lazarus please?

Paul



powtils

  • New Member
  • *
  • Posts: 18
Re: How to connect to MySQL 5.1.30?
« Reply #12 on: December 10, 2011, 12:36:24 am »
My Lazarus  program on MS Windows says "can not work with the installed MySQL client version (6.0.0)"

I didn't know there was a 6.0.0 version of mysql dll. Maybe 6.0.0 is from when I installed MySQL Tools for Windows.

(Mysql query browser is an alternative to phpmyadmin for those that haven't tried it, and is part of mysql desktop tools from their website)

Mario13

  • New member
  • *
  • Posts: 5
Re: How to connect to MySQL 5.1.30?
« Reply #13 on: February 02, 2012, 01:33:45 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.
« Last Edit: February 02, 2012, 01:37:12 pm by Mario13 »

lefti2003

  • New Member
  • *
  • Posts: 22
Re: How to connect to MySQL 5.1.30?
« Reply #14 on: March 21, 2012, 07:14:17 pm »
Hi Mario,
 Is this still the only solution in lazarus 9.30.4 with fpc 2.6.0 since I do not see the MySQL51Connection in the palette. Can you clarify more what you mean by After that, recompile the IDE from the menu options. How do I do this exactly? what are the steps.

Thanks

Lefti