MySQL Native Connector

Hi Heinrich,

Hi,
Could somebody please give me info about where to get the appropriate
source-code
and a bit of "how-to" regarding building the connector for 3.4.3? I will
give it
a try.

The general build instructions for building LibO are here :

http://wiki.documentfoundation.org/Development/Native_Build

if you get stuck, ask on the freenode irc libreoffice developer's channel.

You have to start with a complete build environment, and most of the
suite will probably need to be built anyway before the build can proceed
to compile the connector code.

Alex

...
According to:

<http://wiki.services.openoffice.org/wiki/Database/Drivers/MySQL_Native/1.0>

the source is here:
<http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html>
[MySQL Connector/C++ Download]
http://dev.mysql.com/downloads/connector/cpp/

Hi :slight_smile:
After 1 person has built it for their system can the built package be uploaded somewhere for other people to use? If so could it be uploaded to the new LO Extensions&templates site?

How generic are builds? Would it cover the entire family (Ubuntu, Mint, Trisquel etc), just Debian, one particular release of Debian, or just the specific machine?
Regards from
Tom :slight_smile:

In theory, the builds should be very generic. The problem is when a
downtsream distro tweaks the package to "make it better or more
suitable" for some reason. It is possible, then, for the build to have
new dependencies that are not in the upstream version. For example
Ubuntu is derived from Debian but it has some tweaks that do not allow
for total compatibility with Debian upstream repositories.

From: Alexander Thurgood <alex.thurgood@gmail.com>
Subject: [libreoffice-users] Re: MySQL Native Connector
To: users@global.libreoffice.org
Date: Tuesday, 20 September, 2011, 10:42

Hi all,

> Hi Snip,
> I suppose the fact that I use Debian-Wheezy (next after Squeeze) on a
> 32-bit system might be the reason. Seeing as I don't really have the
> time to do more research I suppose I will just have to live with
> ODBC (or even JDBC :() till somebody comes up with a solution.
> Regards

Try the OOo extension, it seems to work will with 3.3.x and 3.4.x in
Ubuntu without any modifications. I have both versions downloaded for
Linux. I can email them to you off list.

Hi :slight_smile:
Thanks :)  So Building neatly avoids the packagiong issues of .rpm versus .deb?  We just need 1 for 32bit Gnu&Linux and 1 for 64bit, not 1 for each of the main families (Arch? Slackware, Debian, RedHat, errr)?  So, Heinrich's build might be good to upload to your page?

Doing a build sounds quite technical to me.  I need to look at the guide as i have never done it before (well twice doing copy&paste from guides and not having a clue what i was doing).  Anyway, thanks for the link to the guide :)  Heinrich, has it helped?
Regards from
Tom :slight_smile:

Hi NoOp,

...
According to:

<http://wiki.services.openoffice.org/wiki/Database/Drivers/MySQL_Native/1.0>

the source is here:
<http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html>
[MySQL Connector/C++ Download]
http://dev.mysql.com/downloads/connector/cpp/

If you are building LibO on Linux, just follow the build instructions on
the LibreOffice Native build page that I indicated. The build
environment that it is advised to install prior to downloading the
source code for LibO will download and install the mysql C and CPP
connector libraries.

If you are on Windows, the build environment is currently much harder to
setup and get running from what I understand.

Alex

Hi Tom,

Hi :slight_smile:
Thanks :slight_smile: So Building neatly avoids the packagiong issues of .rpm versus .deb? We just need 1 for 32bit Gnu&Linux and 1 for 64bit, not 1 for each of the main families (Arch? Slackware, Debian, RedHat, errr)? So, Heinrich's build might be good to upload to your page?

Yes, the build produces an OXT file, that is all one needs. You have to
hunt around for it a bit, what with the convoluted build and deliver
process that the build goes through, but it can be found when all is
said and done. One thing I do not know yet is whether or not the
absolute path to the library has to be give at configure time (using
autogen.sh). Certainly this was the case for Mac, but I am
assuming/hoping that this is not required for Linux (however, I could be
wrong).

Be aware that building the connector requires extra switches to be
activated at configure time when you use ./autogen/sh. These switches
are the following :

--enable-ext-mysql-connector
--with-libmysql-path="/Users/alex/DevHack/mysql-connector-c-6.0.2osx10.5-x86-32bit"

Like I said, the second switch may well be optional on Linux, but I had
to specify it when building the connector on Mac.

I am currently trying to just build a working LibreOffice installation
set on a *buntu box I happen to have laying around, so I will rebuild
with the corresponding connector switch option once/if that completes.
If I then manage to get something out of it, I'll put it up on the
Extensions site next to the Mac connector.

Alex

Hi :slight_smile:
So, it's a race between you and Heinrich then :)  I like the idea of different people contributing builds as the need arises.  More a community effort and it spreads the knowledge a bit. 
Regards from
Tom :slight_smile:

Hello Alex,
Thanks for the advice! To start with, I am VERY busy (outside IT!) for the coming
week, so I simply won't have the time to do anything in this respect at the moment.
The funny thing is that on my W/Vista-LO 3.3.4 System that connects to a MySQL
database server running on my GNU-Linux-Debian-Wheezy system - the native connector
works like a dream. Therefore I do most "serious" work with the database on
the Windows system at present. Being a Linux fan I think that this is somewhat
shameful... :wink:
Regards
Heinrich

Hi Tom,

So, it's a race between you and Heinrich then :slight_smile: I like the idea of different people contributing builds as the need arises. More a community effort and it spreads the knowledge a bit.
Regards from
Tom :slight_smile:

I have now built a 32bit version of the connector extension for Linux, I
shall be putting it on the extensions site today. It was built on my
XBuntu Natty box. I can safely say that compared to building on Mac,
building on Linux was a doddle.

Alex

Thanks, Alex,
you have certainly beaten me to it. I will try to download/install the
connector on my Debian system this evening and then report on my findings.
Regards
Heinrich
P.S.: I am actually "president" (=worker) of a wind band. This weekend we will be
giving 5 concerts - organising these feats keeps me FAR MORE than busy. The reason I
am actually bothering with all that software is that I have been wanting to write
a software package (based on PHP) for the administration of such a band. I should
maybe also state that I used to work for Mother Blue for a long time as a systems
engineer. AD in most of its ramifications was my subject then. Can't let got of
it (even though I definitely prefer to play music!) :slight_smile:

Unfortunately...

loading component library failed:
file://home/<username>/.libreoffice/3/user/uno_packages/cache/uno_packages/Ap2E1u_/msql-native-connector-1.0.1-linux-32bit.oxt/mysqlc.uno.so

32bit Ubuntu Maverick (10.10). LO 3.4.3. Same results with LO 3.3.4.

Note that my profile path for LO 3.4.3 is:
~/.libreoffice.3.4/3
However the connector is attmepting to install into:
~/.libreoffice/3/user/uno_packages
rather than using the modified data in bootstraprc.

Just to ensure that my path settings for LO 3.4.3 (I do this on purpose
so that I can run multiple instances of LO) wasn't the issue, I then
attempted to install on 3.3.4, where my profile path is the standard:
~/.libreoffice/3/user
Same results. So it's not a profile path issue.

Added note: the OOo mysql native connector is 4.1MB and yours is
375.6KB. That's quite a difference:
$ ls -l mysql*
. 4285738 2011-09-20 09:19 mysql-connector-ooo-1.0.1-linux-intel.oxt
. 384635 2011-09-22 10:02 mysql-native-connector-1.0.1-linux-32bit.oxt

Interestingly, the Ubuntu OOo version (OOo 3.2.1 - go-oo build) is 207.5KB:
$ ls -l /usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt
. 212436 2011-01-28 23:56
/usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt

Hi NoOp,

Unfortunately...

loading component library failed:
file://home/<username>/.libreoffice/3/user/uno_packages/cache/uno_packages/Ap2E1u_/msql-native-connector-1.0.1-linux-32bit.oxt/mysqlc.uno.so

32bit Ubuntu Maverick (10.10). LO 3.4.3. Same results with LO 3.3.4.

Well thanks for testing anyway.

Note that my profile path for LO 3.4.3 is:
~/.libreoffice.3.4/3
However the connector is attmepting to install into:
~/.libreoffice/3/user/uno_packages
rather than using the modified data in bootstraprc.

Just to ensure that my path settings for LO 3.4.3 (I do this on purpose
so that I can run multiple instances of LO) wasn't the issue, I then
attempted to install on 3.3.4, where my profile path is the standard:
~/.libreoffice/3/user
Same results. So it's not a profile path issue.

Hmmm, interesting.

Added note: the OOo mysql native connector is 4.1MB and yours is
375.6KB. That's quite a difference:
$ ls -l mysql*
. 4285738 2011-09-20 09:19 mysql-connector-ooo-1.0.1-linux-intel.oxt
. 384635 2011-09-22 10:02 mysql-native-connector-1.0.1-linux-32bit.oxt

Yes, the Mac one I built is over 1Mb too, I noticed how small the Linux
one was when I copied it over. I didn't seem to get any errors though
when building.

Interestingly, the Ubuntu OOo version (OOo 3.2.1 - go-oo build) is 207.5KB:
$ ls -l /usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt
. 212436 2011-01-28 23:56
/usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt

So the answer may well lie in the specificity of the build environment
because this connector appears to work on the machine I built it on in
the master build, i.e. the future 3.5 code.

Perhaps, it is necessary to build with the 3.4 build source in order to
adapt it to that particular set of code ?? Or then again, perhaps your
Maverick and my Natty have other differences that mean that it doesn't
work. I really don't know enough about it to say, unfortunately and I
won't be able to setup a new build with 3.4 source soon, at least
probably not until next week.

Alex

...

Interestingly, the Ubuntu OOo version (OOo 3.2.1 - go-oo build) is 207.5KB:
$ ls -l /usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt
. 212436 2011-01-28 23:56
/usr/lib/openoffice/share/extension/install/mysql-connector-ooo.oxt

So the answer may well lie in the specificity of the build environment
because this connector appears to work on the machine I built it on in
the master build, i.e. the future 3.5 code.

Perhaps, it is necessary to build with the 3.4 build source in order to
adapt it to that particular set of code ?? Or then again, perhaps your
Maverick and my Natty have other differences that mean that it doesn't
work. I really don't know enough about it to say, unfortunately and I
won't be able to setup a new build with 3.4 source soon, at least
probably not until next week.

Alex

Just took a look at the libreoffice-mysql-connector that comes from the
Natty 11.04 repo & it's install size is 496KB, but it also depends (and
installs) libmysqlcppcon4 which is 782KB.
$ apt-cache depends libreoffice-mysql-connector
libreoffice-mysql-connector
  Depends: libc6
  Depends: libgcc1
  Depends: libmysqlclient16
  Depends: libmysqlcppconn4
  Depends: libstdc++6
  Depends: libstlport4.6ldbl
  Depends: ure
  Depends: libreoffice-core
  Suggests: mysql-server
  Conflicts: ure

I also have Oneiric (11.10) installed in a VM. 11.10 has Ubuntu's LO
3.4.3. In 11.10:
libreoffice-mysql-connector = 492KB
libmysqlcppcon4 = 676KB

I'll poke around later today to see what the differences might be.

Gary

Hi Tom,
Today I tried to download and then activate the MySQL Native Connector you put on
LO-Extensions. However, I still get the error message
"loading component library failed. file:///home.../.../..32bit.oxt/mysqlc.uno.so."
Any idea what could be the reason? The only thing I can think of is that I use
LO 3.4.2 (in addition to using a "bleeding-edge" Debian-Wheezy!).
Thanks for any ideas.
Regards
Heinrich

Hi Heinrich,

Today I tried to download and then activate the MySQL Native Connector
you put on
LO-Extensions. However, I still get the error message
"loading component library failed.
file:///home.../.../..32bit.oxt/mysqlc.uno.so."
Any idea what could be the reason? The only thing I can think of is that
I use
LO 3.4.2 (in addition to using a "bleeding-edge" Debian-Wheezy!).

No, I think it is either a build issue with a library version problem,
or possibly a naming issue, I'm looking into it at the moment and will
update the list if I find a solution.

Alex

Hi Heinrich,

Do you have pyuno (python-uno component loader) installed by any chance?

Alex

Hi :slight_smile:
Thanks for the flowers but it's Alex that has been doing all the work on
this. It's an interesting topic and it would be great to have the connector
available for download or perhaps even better might be to have simple
instructions available so that non-programmers (like me) can build it easily
on their own system.
Regards from
Tom :slight_smile:

HI Alex,
aptitude tells me that I have libobasis3.4-pyuno installed.
regards
Heinrich