I can not use mysql connector in libo 4.4.3.2. Can not load module libmysqlcppconn.so

Hi there,

I would like to know how I can solve the problem of loading modules. It says it can not load modules when I create a libreoffice base database and want to connect to mysql. The exact error is:

SQL-status: 08001 Unable to load the libmysqlcppconn.so library.

Now, when I do a search the file libmysqlcppconn.so, it can not be found.

user@computer ~ $ find libmysqlcppconn.so

and

user@computer ~ $ locate libmysqlcppconn.so

Also find nothing. Then I extract the .oxt file with my file archiver and find the libmysqlcppconn.so. So can someone tell me where to put is so that I can see if this solves my problem?

It seems the extention manager from libreoffice isn’t working properly.

Thanks in advance.

EDIT: It seems I have found the file I’m looking for but it is still not working. The file I found is here:

/home/user/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lubwewqi.tmp_/mysql-connector-linux_4-3_x86_64.oxt/libmysqlcppconn.so

EDIT: If you have a problem like this, then you need to enable “Pooling” in the LO settings. You can find it here:

Tools → Options → Libreoffice Base → Connections → Enable pooling → Set mysql option (org.openoffice.comp.drivers.MySQL.driver) to yes, leave the time out.

Then select OK and try it again.

Please edit your question to clearly state what OS you’re using and include version #'s for everything you are using. There are those of us reading to learn and also to possibly offer help, but it really matters very much what you’re using. Thanks.

Edit per comments below: AFAIK on further review the MySQL connector extension is now packaged by default into LibreOffice 5 in Linux and maybe something lower, maybe 4.4. My Linux Opensuse machine is running what appears to be a standard-installed (locked) version 1.0.2 of mysql-connector-ooo which corresponds to the version available for download online at this location for 4.x. I cannot see in the release notes documenting when the extension began to be shipped standard. From your paths it appears that you are working another version of the extension for LibreOffice 4.2 and 4.3. Internally in the oxt archive, this is labeled as version 1.0.4_3 in description.xml which might just be targeted at LO 4.3. As you are now running 4.4, perhaps that extension is too specific.

The information at this location concerning mysqlc and libmysqlcppconn may be helpful. The link discusses various build flags that may cause LO to rely on one library or the other. If you are using a Mint-compiled build of LO, it may be they built it with a flag --with-system-mysqlcppconn. The action step suggested on the linked page then is as follows: " libmysql and libmysqlcppconn are probably available as a package/port. Install them using your distribution’s tools [i.e., Linux mint repositories]. Make sure to install the development packages (whose name usually ends with -dev or -devel), and not only the libraries themselves."

In OpenSuse and some related distros then, I would browse here or look in the installed repositories. Not sure how Mint does this.

I have had no problems so far with the 4.x connector / 1.0.2 connector extension, which has been the most trouble-free among the options JDBC ODBC and various vendors connecting to MySQL backend.

(if this answers your question, please accept the answer by clicking the check (image description) to the left)

Hi Doug, Thanks for answering but this is not the solution. I tried it but I get “This extension ‘mysql connector’ will not run on this computer”. I do not know which version this is but I’m using Linux. I tried that as well and got the extension I already had. I do not know if there is a new version for 4.4 (I’m using Libre Office 4.4.4.3)

I have the extension 4.x active on both Windows and Linux machines, OpenSuse 13.2. LO 5 is the development version. I would force reinstall of LO. If you are simply trying to connect to MySQL without preference of connectors, consider the JDBC / Java connectors here and here. See instructions here.

Hi Doug, I already reinstalled LO. I even updated from 4.4.3.2 to 4.4.4.3. I also have a SSD installed, so I would prefer not to use java in any kind of way, especially Oracle java. I have one option left which is virtualbox. I have windows 7 installed there. I will try it. I’m using Linux Mint 17.2

I wouldn’t want to encourage reliance on Windows either. I was under the impression that LO already relies heavily on Java, in its case IcedTea or something like that, but others may be better informed. I will look around further to see if there is anything else I can say about this.

The folder I found in home directory you reference is empty; my connector payload appears to be at /usr/lib/libreoffice/share/extensions/mysql-connector-ooo/. The location you reference appears to be the archive of the downloaded extension itself; the oxt archive does indeed contain that library. The business end of the connector on my system appears to be mysqlc.uno.so in the referenced directory, and Drivers.xcu in the subdir registry/data/org/openoffice/Office/DataAccess/.

Indeed, Components.rdb in the same folder contains a single reference to <component loader="com.sun.star.loader.SharedLibrary" uri="./mysqlc.uno.so"><implementation name="com.sun.star.comp.sdbc.mysqlc.MysqlCDriver"><service name="com.sun.star.sdbc.Driver"/></implementation></component></components>

Hi Doug, I will not rely on Windows. But I have tested it. It works for now, the only thing is, not on linux. The steps I have taken are 1) in my.cnf (mysql config file) comment out bind_address = 127.0.0.1. 2) restart the server. 3) create a base database and connect to mysql. During this process the address changes. For example: if the database is located at 192.168.1.5 and you make a test connection then it will say 192.168.1.15. So, probably some coding error?

Also, I connected as root, which you must not do. The first time I got a connection but I was not allowed. After some research I came to know that you cannot login as root. So I created a user account for libreoffice and loggedin that way. Now it works in windows but not linux. I got the same error about not be able to load that library from the first post, in linux. The problem still exists.

That is right. LO does rely on Java. But like Oracle’s Java which causes a lot of write action to the ssd drive, which is not good for the drive. So, if I use Java then it came a long with Linux it self and not a 3rd party like Oracle.

I have found maybe a solution to this. Kinda a workaround? This is what I did. I remembered the xml file you mentioned. I had a look at it, then I remembered some option in LO called pooling. You can find it in the settings like this: Tools → Options → LO base → Connections → Pooling. Enable it en select the mysql option set it to yes. Then save it and create a base database and connect to Mysql. I still can’t login though but I get some error which means there is a connection.

By adding a correct user (non administrative) it now works! :-). Doug, for you a very special thanks for helping me sorting this out. Thank you.

I don’t know Doug, I always remove the Mint compiled version for the latest version of LO from the website. It has worked nice over the years since I use Linux Mint. But the solution is there and I can get to work. Thanks Doug.

I just upgraded to Ubuntu 16.04. When I tried to use Base to connect to MYSQL I received the unexpected error message: “unable to load the libmysqlcppconn.so library”. Previously, on prior versions of Ubuntu, the native MYSQL connector worked. I tried the solution posted by Annonymous2015 on July 24, 2015 as a comment in the prior answer. In my case, there are two MYSQL drivers listed. The one that worked is: “org.openoffice.comp.drivers.MYSQL.Driver”. (PS: This was meant as comment.)

Bad news, upon further use, the “fix” seems to be sporadic. It works sometimes, other times it does not. I have set-up an alternative solution, to use the MYSQL JDBC driver.

Annonymous12015 previously wrote: “I have found maybe a solution to this. Kinda a workaround? This is what I did. I remembered the xml file you mentioned. I had a look at it, then I remembered some option in LO called pooling. You can find it in the settings like this: Tools → Options → LO base → Connections → Pooling. Enable it en select the mysql option set it to yes. Then save it and create a base database and connect to Mysql. I still can’t login though but I get some error which means there is a connection.”

I recently updated to Linux Mint 18 and the native mysql connector doesn’t reliably work here either. Sometimes it works, some times it does not. Installing libmysqlcppconn-dev makes no difference. Previously I had the same error but I managed to fix it back then. This time however I can’t get it to work.
There is probably something wrong with the combination of Ubuntu 16.04 and the latest native mysql connector.

In my hands the MySQL connector doesn’t work either (Linux Mint 18 LO Version: 5.1.4.2)
My workaround: connect using JDBC (Java Database Connectivity).
Download from here MySQL :: Download Connector/J
extract at location of your preference
add classpath as follows:
open libreoffice Tools > Options > LibreOffice Advanced > Class Path > Add Archive > navigate to the dircectory containing “mysql-connector-java-5.1.40-bin.jar”