Recent

Author Topic: How do I install mysql client library on ubuntu?  (Read 37912 times)

Michael Collier

  • Sr. Member
  • ****
  • Posts: 323
How do I install mysql client library on ubuntu?
« on: January 25, 2016, 11:38:34 am »
My ubuntu machine has mySql v5.6
+-------------------------+
| version()               |
+-------------------------+
| 5.6.27-0ubuntu0.14.04.1 |
+-------------------------+

I'm using lazarus v1.4.4 fpc 2.6.4

If I try and connect to mySQL database using TMySQL56Connection I get error:
"TMySQL56Connection can not work with the installed MySQL client version: Expected (5.6), got (5.5.46)."

Wiki page http://wiki.freepascal.org/SQLdb_Package  does say I need to install
"Make sure you have the relevant database client/driver installed. "

But I don't know what that means, I did some searching a found info on this but it looked outdated, and involved copying files for my lib directories e.g. here http://wiki.freepascal.org/mysql#SQLDB

Is there a straightforward way of doing this that I have missed please?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • FPC developer.
Re: How do I install mysql client library on ubuntu?
« Reply #1 on: January 25, 2016, 12:25:34 pm »
Install/update the package mysql-client ?

Michael Collier

  • Sr. Member
  • ****
  • Posts: 323
Re: How do I install mysql client library on ubuntu?
« Reply #2 on: January 25, 2016, 01:50:53 pm »
That's the part I'm probably having trouble with, do I need to find a package called mysql-client.lpk?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8797
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I install mysql client library on ubuntu?
« Reply #3 on: January 25, 2016, 01:53:31 pm »
That's the part I'm probably having trouble with, do I need to find a package called mysql-client.lpk?
No since there's no such a package. What marcov means is mysql-client package from your OS, assuming this is a Linux system. Otherwise, search for your OS way of doing it.

mig-31

  • Sr. Member
  • ****
  • Posts: 306
Re: How do I install mysql client library on ubuntu?
« Reply #4 on: January 25, 2016, 02:24:08 pm »
You should use TMySQL55Connection to connect MySQL 5.5.x
Lazarus 2.2.6 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

Michael Collier

  • Sr. Member
  • ****
  • Posts: 323
Re: How do I install mysql client library on ubuntu?
« Reply #5 on: January 25, 2016, 03:02:05 pm »
My system is already using mysql client 5.6 I think?.. here is what happens when I try to update in terminal

user1@ubuntu100:~$ sudo apt-get install mysql-client-5.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-client-5.6 is already the newest version.
The following package was automatically installed and is no longer required:
  mysql-server-core-5.6
Use 'apt-get autoremove' to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.


Leledumbo

  • Hero Member
  • *****
  • Posts: 8797
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I install mysql client library on ubuntu?
« Reply #6 on: January 26, 2016, 08:35:39 am »
Check libmysqlclient-dev, hopefully that's the correct name (I don't use debian derivatives, so the name might be wrong).

Michael Collier

  • Sr. Member
  • ****
  • Posts: 323
Re: How do I install mysql client library on ubuntu?
« Reply #7 on: January 26, 2016, 11:58:47 am »
Thanks for that, I tried this:

sudo apt-get install libmysqlclient-dev

and it installed 5.5.46

Setting up libmysqlclient-dev (5.5.46-0ubuntu0.14.04.2) ...

I searched for ways of bumping it up to 5.6 but it seems problematic and may mess things up so I'll leave it and try connecting with 5.5

Leledumbo

  • Hero Member
  • *****
  • Posts: 8797
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I install mysql client library on ubuntu?
« Reply #8 on: January 26, 2016, 01:46:59 pm »
try to update your package manager database, it's very uncommon to have separate version between binary, runtime and development library unless due to outdated database.

Michael Collier

  • Sr. Member
  • ****
  • Posts: 323
Re: How do I install mysql client library on ubuntu?
« Reply #9 on: January 26, 2016, 06:02:46 pm »
Ok I did these:


sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install libmysqlclient-dev


I still get this message for my 5.5 client-dev
libmysqlclient-dev is already the newest version.

I think the problem is that ubuntu wants to stick with 5.5 for everything, perhaps I forced the install of 5.6 server sometime back, I noticed when I used the install gui that comes with ubuntu (ubuntu software centre) they were quoting 5.5 for mysql stuff.

I've since managed to connect to the sever using lazarus connection component v5.5

I hope this works out for me without problems, fingers crossed..

Leledumbo

  • Hero Member
  • *****
  • Posts: 8797
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I install mysql client library on ubuntu?
« Reply #10 on: January 26, 2016, 07:03:26 pm »
perhaps I forced the install of 5.6 server sometime back
Ow... that can't be helped, then. Going back to distro supported packages might indeed be better. 5.5 to 5.6 has no breaking changes, it's mainly performance improvements and new features.

 

TinyPortal © 2005-2018