any working howto for accessing mysql/mariadb from libre office?

Greetings,

as per subject. I have a Fedora 20 x86_64 box here, running LO
4.2.5.2, with all updates installed.

NONE of the official howtos, forums, whatever around contains a
usable, step by step description of what should be done to connect
Base to a local mariadb / mysql database which is running and already
accessible from the same computer, both from the command line and from
php through the local web server. The closest I've got, AFTER already
doing plenty of searches for any variant of mysql, libre office and
the several error messages below, is:

(configuring the
connect to existing database mysql
connect using jdbc

database name: mydb

server: localhost

port number 3306

MySql JDBC Driver class:

com.mysql.jdbc.Driver (and when I click on "Test Class" I get "the
                 jdbc driver was loaded successfully")

user name marco, password required yes

Then I click on "Test Connection" I get

SQL Status: 08S01
Communications link failure

the last packet sent successfully to the server was 0 milliseconds
ago. The driver has not received any packets from the server.

I get this on the command line where I had launched lo:

Exception in thread "Thread-26" java.lang.NoClassDefFoundError: com/jdbc/mysql/Driver
Caused by: java.lang.ClassNotFoundException: com.jdbc.mysql.Driver
       at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

from http://stackoverflow.com/questions/15827547/java-lang-classnotfoundexceptioncom-mysql-jdbc-driver

I read that that message means "problem is not in the code, but you don't have added the driver to your project!!! You have to add the *.jar driver to your project... "

but I HAVE added in Options->ADvanced the class path
/usr/share/java/mysql-connector-java.jar. Maybe the problem is that
this LO (as packaged by Fedora, that is) is using JRE 1.7.0_60 by
ORACLE?

Also, adding ?autoReconnect=true to the database name, as some of the
many howtos and forums I already read, doesn't change anything.

What now? First I thought the problem could be on the fedora side
(maybe something in selinux/firewall) but why would it work both on
the command line and on http/php from the same machine? that's why I
am also asking here.

   TIA,
   Marco

Hi Marco,

server: localhost

Try 127.0.0.1 instead of localhost, just to test

from http://stackoverflow.com/questions/15827547/java-lang-classnotfoundexceptioncom-mysql-jdbc-driver

I read that that message means "problem is not in the code, but you don't have added the driver to your project!!! You have to add the *.jar driver to your project... "

but I HAVE added in Options->ADvanced the class path
/usr/share/java/mysql-connector-java.jar. Maybe the problem is that
this LO (as packaged by Fedora, that is) is using JRE 1.7.0_60 by
ORACLE?

Maybe, I don't have Fedora or the LO packages that go with it.

Also, adding ?autoReconnect=true to the database name, as some of the
many howtos and forums I already read, doesn't change anything.

This should not be need when you are connecting to a locally hosted
instance of the mysql server.

What now? First I thought the problem could be on the fedora side
(maybe something in selinux/firewall) but why would it work both on
the command line and on http/php from the same machine? that's why I
am also asking here.

A few suggestions :

- the command line client uses a mysql socket over UDP, LO on the other
hand, requires a TCP connection as far as I know - if you can access
your mydb via phpmyadmin, then I guess that a TCP socket is already
open, the question then remains as to where it is located - LO seems to
have that path hardcoded for some reason, so you might have to change
your mysql configuration to put that socket where LO expects to find it;

- is the default connection to the mysql server configured to run over
SSH (i.e. in the mysql server configuration) ? - there is/was a known
issue recently fixed (I think for 4.3, not sure whether backported) that
prevented users from gaining access to a ssh-connection on the mysql server.

Alex