Download it now!
Bug 117931 - Mysql Connector Extension 4-3 no longer works with current LibreOffice
Summary: Mysql Connector Extension 4-3 no longer works with current LibreOffice
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
6.0.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-31 11:28 UTC by Bojan
Modified: 2018-06-27 08:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bojan 2018-05-31 11:28:38 UTC
Description:
After upgrading the OS from Suse Leap 42.3 to Leap 15.0 mysql/mariadb database cannot be accessed any more. The error message reads as follows:
The connection to the data source could not be established.
SQL Status: 08001
Unable to load the libmysqlcppconn.so library.
So far I used a native mysql connector mysql-connector-linux_4-3_x86_64.oxt without any problems.

Steps to Reproduce:
1.Run LO and open a template with database fields entry
2.Press Ctrl-Shift-F4
3.Enter a password => Error message

Actual Results:  
No connection to mysql/mariadb database

Expected Results:
Connection to mysql/mariadb database


Reproducible: Always


User Profile Reset: Yes



Additional Info:
I tried mariadb JDBC driver and it worked fine. However, I sticked to the native driver since all my templates are populated with plurality of database fields, and it would be a real nightmare to make everything from the scratch.


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Comment 1 Bojan 2018-05-31 15:57:33 UTC
I also tried LO 5.4.7 and LO 6.1 beta. However, the result was the same; no connection to the database.
Comment 2 Alex Thurgood 2018-06-04 07:05:32 UTC
@Bojan : where di you get the native mysql connector from ?

LibreOffice doesn't provide a native connector with the official TDF download, so either :

- you downloaded a connector extension from the extensions website - in this case, it is the builder/provider of the extension that needs to be contacted ;

- you are using a distrib provided connector (Suse Leap or one of its repositories), in which case the problem should be reported to them.


In all likelihood, the connector you were using needs to be rebuilt/recompiled against a current version of the connector source code and LibreOffice code tree.


Please provide the required information concerning the provenance of the connector extension you are using and which no longer works.

Setting to NEEDINFO pending requested information.
Comment 3 Alex Thurgood 2018-06-04 07:09:02 UTC
For what it is worth, in my own build of LibreOffice on (1) MacOSX and (2) Linux Mint, the connector extension that I build myself functions with current versions of LO-master.

Naturally, these connector builds are fairly specific to their respective build environments.
Comment 4 Bojan 2018-06-04 07:34:38 UTC
(In reply to Alex Thurgood from comment #2)
> @Bojan : where di you get the native mysql connector from ?
> 
> LibreOffice doesn't provide a native connector with the official TDF
> download, so either :
> 
> - you downloaded a connector extension from the extensions website - in this
> case, it is the builder/provider of the extension that needs to be contacted
> ;
> 
> - you are using a distrib provided connector (Suse Leap or one of its
> repositories), in which case the problem should be reported to them.
> 
> 
> In all likelihood, the connector you were using needs to be
> rebuilt/recompiled against a current version of the connector source code
> and LibreOffice code tree.
> 
> 
> Please provide the required information concerning the provenance of the
> connector extension you are using and which no longer works.
> 
> Setting to NEEDINFO pending requested information.

Well, I got the connector from the extension site. Sadly, it looks like the mysql/mariadb connector is not maintained any more. So what do you suggest me to do, how to recompile the connector. I beleieve, I must obtain a source code at first. O God, what a mess.
Comment 5 Alex Thurgood 2018-06-04 10:52:43 UTC
Suse Leap probably provides a native connector of its own, but it will be packaged to work with whatever version of LibreOffice that Leap provides by default. 

If you want to use a more recent version of LO than that provided with Suse Leap, then you will need to either build the connector from source, or else find someone who can do that and make the connector available.
Comment 6 Bojan 2018-06-05 05:39:37 UTC
Well, yes I am aware of everything you said. So, my next question is do you know a person who would do the job, compiling a new connector. I search for any info on a person that created the connector I used so far, but with no luck. Do you, or anybody else, have any info with this regard.
Comment 7 Alex Thurgood 2018-06-06 06:23:08 UTC
(In reply to Bojan from comment #6)
> Well, yes I am aware of everything you said. So, my next question is do you
> know a person who would do the job, compiling a new connector. I search for
> any info on a person that created the connector I used so far, but with no
> luck. Do you, or anybody else, have any info with this regard.

Unfortunately, not that I know of.
Comment 8 Lionel Elie Mamane 2018-06-06 07:49:47 UTC
The connector source code is in the LibreOffice source tree, configure it with --enable-ext-mariadb-connector and build LibreOffice, it will build the extension along.

There was a known/planned ABI break in... LibreOffice 4.0? Something like that. Also, the ABI sometimes depends on the compiler brand and version, stuff like that. Except for that, compilations of the extension should be compatible across LibreOffice versions.
Comment 9 Bojan 2018-06-07 07:41:55 UTC
Thank you for the tip. I tried to find connector source with no luck. And on the other hand, the entire procedure to build a new connector is far to much for my capabilities. I am really surprised how small number (almost close to zero) of LO community utilizes LO in connection with databases such a smysql, mariadb etc, because no rsponse to the problem has practically been obtained.
Now, all I have to do is wait patiently for a soul to cretae a new version of mysql/mariad native connector. I hope I will not wait for eternity.
Comment 10 Alex Thurgood 2018-06-08 07:07:06 UTC
(In reply to Bojan from comment #9)

> Now, all I have to do is wait patiently for a soul to cretae a new version
> of mysql/mariad native connector. I hope I will not wait for eternity.

Suse Leap 15.0 contains the libreoffice-base-drivers-mysql package to correspond to LibreOffice Version 6.0.4.2.

See:

https://software.opensuse.org/package/libreoffice-base-drivers-mysql

so problem solved ?
Comment 11 Alex Thurgood 2018-06-08 07:13:59 UTC
@Bojan : install the connector provided by Suse, if it still doesn't work, then report it against the Suse bugtracker.

With most current distro providers supplying fairly up-to-date versions of LibreOffice, the question of a separate connector extension becomes somewhat moot.
Comment 12 Lionel Elie Mamane 2018-06-08 09:57:59 UTC
_Remove_ any other version of the MySQL/MariaDB LibreOffice connector you have installed (e.g. downloaded from extensions website), install the one from SuSE, if necessary reset your profile's extension database/registry and then let's see if it solves the problem.
Comment 13 Bojan 2018-06-08 10:33:37 UTC
Of course I removed previous LO connector, the problem is that libreoffice-base-drivers-mysql provided by Suse will not install due to lack of several packages relating to the Suse version of LO.
Nevertheless, some mintus ago I installed the Suse version of LO with all dependecies required. When I try to connect to mysql base the reply was some error relating to missing the libmysqlclient_r.so.
Afterall, I believe the problem is much more deeper than just replacing "original" LO with the Suse version thereof. It looks like the connection between the connector and the LO (v6.0.4.2) is broken.
Comment 14 Lionel Elie Mamane 2018-06-08 10:48:13 UTC
I missed that you are not using the SuSE version of LibreOffice.

OK, I read your original bug report afresh. You mean the problem appeared when upgrading the OS, but _not_ upgrading LibreOffice, of which you use a TDF build?

Then, from the error message, it looks like it is the MySQL C++ Connector, which which is used by the MySQL LibreOffice Connector, which is the problematic step. This could be:

1) C++ ABI change in Suse between the old OS version and the new OS version.
2) Removal of libmysqlclient.so.18 from SuSE in the new version
   (e.g. replaced by a new version libmysqlclient.so.19 or .20 or ...)

I see that the .oxt contains the MySQL client (C) library, but under the wrong name... It calls it libmysqlclient_r.so while libmysqlcppconn.so expects libmysqlclient.so.18.

Try these things:

1) Remove SuSE version
2) Install the extension .oxt again (sorry...)
3) In the installation directory of the extension, make a link (or copy)
   of libmysqlclient.so.18 to libmysqlclient_r.so
4) It works? We found the issue.
5) If not, try copying libmysqlclient_r.so to /usr/lib/x86_64-linux-gnu/
   (or whatever SuSE uses as library directory *by* *default*)
Comment 15 Bojan 2018-06-11 05:49:09 UTC
Well, this is the result of following your instructions.
1. No libmysqlclient is provided by Leap 15.0
2. No. libmysqlclient or libmysqlclient_r.so version can be located in my system.
3. Only the library libmysqlcppconn.so.7 is installed.

It looks like libmysqlclient has been replaced by libmysqlcppconn.
I started LO ans a new (fresh) user so that the directories /4/user/... have been created from the scratch. I installed mysql-connector and at first run LO made a connection to mysql/mariadb. Great job, I say. than I added other extensions, all relating to language dictionaries. Re-run the LO and horror, no mysql connection any more. Do you think, there is some sort of the connection between the language extensions and mysql-connector. I would say there is none, since all these extension shave already been successfully used in the past. So, I removed extensions one-by-one, but with no luck. The connection to the mysql cannot be established. Extensions have no effect whatsoever.
As to the messed up C libraries, I must agree with you. I already found some discussions about the issue on the net, but can not find it again.
Comment 16 Lionel Elie Mamane 2018-06-11 06:50:39 UTC
(In reply to Bojan from comment #15)
> Well, this is the result of following your instructions.
> 1. No libmysqlclient is provided by Leap 15.0

Try package mariadb-connector-c
It seems to me that it contains libmysqlclient.so.18

> 2. No. libmysqlclient or libmysqlclient_r.so version can be located in my
> system.
> 3. Only the library libmysqlcppconn.so.7 is installed.

That's surprising. libmysqlcppconn uses libmysqlclient. Unless the SuSE package links it statically?

> It looks like libmysqlclient has been replaced by libmysqlcppconn.

I don't think so. AFAIK libmysqlcppconn uses libmysqlclient.

> I started LO ans a new (fresh) user so that the directories /4/user/... have
> been created from the scratch.

I think you either have to install package mariadb-connector-c from SuSE, or, form my previous message:
3) In the installation directory of the extension, make a link (or copy)
   of libmysqlclient.so.18 to libmysqlclient_r.so
Comment 17 Bojan 2018-06-11 10:59:37 UTC
Thank you for all the tips. Now, I finally manage to figure out some mysteries. At first, I installed libmariadb-devel package which contains libmysqlclient_r.so file. The connection of LO to mysql still does not work, of course. The final test and answer to all questions would be your suggestion "In the installation directory of the extension, make a link (or copy) of libmysqlclient.so.18 to libmysqlclient_r.so".
One problem still persists. I don't know the path where the extension is installed. I checked /user/.config/libreoffice/4/user/extensions and there are two subdirectories, bundled and shared. None of them contains anything about mysql extension. On the other hand, if I rename the extensions directory and restart LO, all my extensions are still visible in LO. Weird.
Can you help.
Comment 18 Bojan 2018-06-11 11:12:06 UTC
Sorry, made a mistake. On renaming directory /libreoffice/4 no extensions are visible. However, it happens twice with fresh /4/ directory, that LO connected well to mysql only in the first instance. As soon as I restarted LO, no connection was available.
Comment 19 Lionel Elie Mamane 2018-06-11 11:17:27 UTC
(In reply to Bojan from comment #17)
> I don't know the path where the extension is installed.

Should be one of the subdirectories of
~user/.config/libreoffice/4/user/uno_packages/cache/uno_packages/
Comment 20 Bojan 2018-06-11 11:35:39 UTC
OK, I got it.
There are two files in the extension directory, namely libmysqlcppconn.so and libmysqlclient_r.so. I renamed them and made soft links to respective files in /usr/lib64 directory. The LO crased on coneection to mysql. Than, I tried soft linking one by one, not both files at the same time. The LO crashed on soft link to libmysqlcppconn.so, and the connection can not be established on soft link to libmysqlclient_r.so saying that libmysqlcppconn.so is missing (or something). Please note, the libmysqlcppconn is of version 7.1.1.9, and the libmysqlclient is of the version 19.
Comment 21 Lionel Elie Mamane 2018-06-11 11:45:51 UTC
Sorry if I was not clear.

Make a link named "libmysqlclient.so.18" that links to "libmysqlclient_r.so" in the same directory.

Let libmysqlcppconn.so alone.
Comment 22 Bojan 2018-06-12 05:16:07 UTC
OK. In the directory where mysql extension is installed, I created a symbolic link named libmysqlclient.so.18 pointing to the libmysqlclient_r.so in the same directory. Running LO resulted in the following error.
Unable to load the libmysqlcppconn.so library.
The very same error occurred when the symbolic link was pointing to the /usr/lib64/libmysqlclient_r.so
Than, I deleted all symbolic links previously created and enabled in LO Connection pooling enabled. When LO has been restarted the connection to mysql worked great. However, when I restarted LO again, the connection has gone with the above mentioned error.
Comment 23 Lionel Elie Mamane 2018-06-12 07:06:47 UTC
The problem is not what I had thought. Since it seems to be reproduced only on one version of SuSE, let's try to get a SuSE-using developer interested.
Comment 24 Bojan 2018-06-12 09:27:08 UTC
What a pity you gave up. Just a last info. I deleted mysql-connector v.4.3 from LO and installed aoo-my-sdbc-1.2.0-linux-x86-64.oxt; this one is from Apache. You wouldn't believe it. It works. Everything works fine but one query, which always returns empty set. I guess the query must be amended. I will try to do something.
Comment 25 malboarg 2018-06-20 19:07:24 UTC
For what it is worth:

Version: 6.0.5.1
Build ID: 0588a1cb9a40c4a6a029e1d442a2b9767d612751
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2;

Steps:
1) LO->Tools->Extensions Manager-> Add     mysql-connector-linux_4-3_x86_64     (downloaded from https://extensions.libreoffice.org/extensions/mysql-native-connector  mysql-connector-linux_4-3_x86.oxt ( File size: 1368 kb ))

2)Open LO Database-> Connect to existing database (MYSQL)-> Connect Directly

3)complete database name,server,port,user,password

4)Database access ok.
Comment 26 Bojan 2018-06-21 07:33:02 UTC
Version: 6.0.4.2
Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
CPU threads: 4; OS: Linux 4.12; UI render: default; VCL: gtk2

Steps:
1) LO->Tools->Extensions Manager-> Add     mysql-connector-linux_4-3_x86_64     (downloaded from https://extensions.libreoffice.org/extensions/mysql-native-connector  mysql-connector-linux_4-3_x86.oxt ( File size: 1368 kb ))

2)Open LO Database-> Connect to existing database (MYSQL)-> Connect Directly

3)complete database name,server,port,user,password

4)Database access NOT ok; error message "Unable to load the libmysqlcppconn.so library"

Now, after few days, I wonder if this problem lies in the server. Namely, the server OS is SuSe Leap 42.1 and the command "locate libmysqlcppconn" retunrs nothing. In addition, the command "locate libmysql" returns only libmysqlclient. Could it be that this is the core of the problem.
Comment 27 malboarg 2018-06-23 02:01:33 UTC
For what it is worth:
I have disabled connection pooling and I could reproduce de error.
(Unable to load the libmysqlcppconn.so library)

So,I reconnected connection pooling like this:
1. Open LO-->Tools-->Options-->LibreOffice Base-->Connections
2. Click on Connection Pooling Enabled
3. Select com.sun.star.comp.sdbc.JDBCDriver
4. Click on Enable pooling for this driver
5. Select org.openoffice.comp.drivers.MYSQL.Driver
5. Click on Enable pooling for this driver
6. Click ok

7. LO-->Tools-->Extension Manager
8 Select MySQl Connector
9 Disable and Enable
10 Restar LO

11)Open LO Database-> Connect to existing database (MYSQL)-> Connect Directly

12)complete database name,server,port,user,password

13)Database access ok.
Comment 28 Alex Thurgood 2018-06-25 06:41:29 UTC
(In reply to malboarg from comment #27)


> 3. Select com.sun.star.comp.sdbc.JDBCDriver
> 4. Click on Enable pooling for this driver

Why do points 3 and 4 above ? Selecting JDBC driver connection pooling for the native C/C++  mysql driver is irrelevant / unnecessary. I'm assuming that choosing this makes no difference to the result ?
Comment 29 malboarg 2018-06-25 20:02:23 UTC
May be. The idea of the test case was to disable connection pooling , and try to connect to MYSQL , and then enable connection pooling with exactly the same drivers than before and try to connect again.
Now I'm testing again and the behavior is erratic. Sometimes connect and others don't.
Comment 30 Bojan 2018-06-26 11:06:29 UTC
 I followed instruction of malboarg 2018-06-23, and LO now connects well to mysql database. However (there is always however), LO crashes upon closing the active window (if only one window is open).
Comment 31 Alex Thurgood 2018-06-26 11:42:52 UTC
Closing as WFM per comment 24 and 30

The issue :

- is not systematically reproducible;
- only appears in Suse Leap;
- has been resolved per comment 24 and comment 30
Comment 32 Bojan 2018-06-27 08:07:58 UTC
I doubt the closing of the issue is a right decision. The bug still exists and it is not resolved per comment 24 and 30. Since LO works or not works as per comment 27 and 29, the issue should be paid attention and solved in a manner for LO to work well with all distributions. On the other hand, I am sure that a brand new mysql/mariadb connector would be the best solution. That, however, is far beyond my skills and knowledge.