How to connect to a MySQL database from LibreOffice using JDBC on Slackware Linux

The LibreOffice Base application gives us the opportunity to work with MySQL databases in a graphical interface. I especially find the “Query Design View” useful when working on larger MySQL databases.

This tutorial demonstrates how configure the MySQL Connector/J (which is the official JDBC driver for MySQL) on Slackware 14.1 x86_64.

Tested on:
Slackware 14.1 x86_64
Java Platform (JDK) 8u45
mysql-connector-java-5.1.35 (JDBC)


Get the compressed highlights from Youtube:


On Slackware it’s necessary to comment out the SKIP=”–skip-networking” directive from MariaDB which is enabled by default.

vi /etc/rc.d/rc.mysqld
# SKIP="--skip-networking"
/etc/rc.d/rc.mysqld restart

Failure to do so will result in the following error message when using the JDBC driver:

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

Install the JDBC driver

Get the required software from the following locations:
Download Connector/J
Java SE Downloads
MySQL Mirrors

# Download the JDBC driver from a MySQL mirror
wget -q

# Download the JDBC driver checksum file
wget -q

# Verify the integrity of the downloaded file
md5sum -c mysql-connector-java-5.1.35.tar.gz.md5

# Extract only the JAR file without its parent folder
tar -zxf mysql-connector-java-5.1.35.tar.gz mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar --strip-components=1

# Move the JAR file to the extensions folder
mv mysql-connector-java-5.1.35-bin.jar /usr/lib64/java/jre/lib/ext/

# Delete the files we no longer need
rm mysql-connector-java-5.1.35.tar*

Configure the JDBC driver for use with LibreOffice

Make sure that LibreOffice is using a java runtime environment. Navigate to “Options” => “Advanced” and verify the configuration.

Start the Base application and choose the option to connect to an existing database by selecting the JDBC driver.

Specify the datasource and driver class on the following format:
DataSource URL: mysql://host/db_name_here
JDBC Driver class: com.mysql.jdbc.Driver
Click on “Test class” to verify that the driver is working.

Finally, configure user authentication against the chosen database. Fill in your username and tick the “Password required” field. Click on “Test connection” to verify your credentials.

The process in pictures:

Slackware ARM on the Raspberry Pi 2 – 38 days later

Excited by the prospect of hosting my blog on the new Raspberry Pi 2, I decided lately to wave goodbye to the local datacenter and unleash a Slackware Linux box into the wild (full story here).

Everything went (mostly) without a hitch until I wanted to get back in sync with the Slackware-current tree. After applying the available updates and issuing a reboot, the system seemed operational and nothing from the logs gave any indication of imminent failure.

Vmscan.c - Linux VM subsystem
Bob, we have a problem!

The next morning however, the system was unresponsive and syslog seemed to point to the kernel swap daemon, complemented with page allocation errors and a flood of stalls on CPUs/tasks from RCU.  To make matters worse, the system would completely lock up during troubleshooting.

Forcing fsck on all partitions revealed errors on both the FAT32 /boot partition (dirty bit) and the /(root) ext4 partition (multiply-claimed blocks in inode). I suspect these errors were caused by overclocking the RPi2 to its limit as it seem the system might not have had time to sync changes to disk before shutting down.
In hindsight, I remember that I experienced data corruption with one PHP file in the WordPress installation directory, but at the time I blamed it on a borked upgrade. I should probably have taken it as a sign of troubles to come.

RPi2 modified config:

Raspberry Pi 2 Model B
Powered by SARPi2

After implementing these changes, a week has gone by without any more issues. Easing up on the overclocking means PHP execution is back to a crawl, but that’s what caching is for I guess.

Anyhow, the dream of independent hosting with Slackware ARM on the Raspberry Pi 2 lives to see another day.

WordPress on Raspberry Pi 2 running Slackware ARM

Two weeks ago, I decided to move this blog from its old hosting and deploy it on a Raspberry Pi 2. The geek in me could no longer resist the urge to discover if a $35 worth computer could replace the need for commercial hosting. Besides, what a great opportunity to finally get my hands on Slackware’s official ARM port.

RPi2 setup:

Raspberry Pi 2 Model B
Raspberry Pi 2 Micro USB Power Cable 1.2A
MicroSDHC Ultra UHS-I 32GB

LAMP setup:

Slackware ARM current
Package series: a, ap, d, l, k, n (and a few from “x”).
Apache 2.4.12 (rebuilt)
MariaDB 5.5.40 (rebuilt)
PHP 5.4.40 with mod_proxy_fcgi and php-fpm (rebuilt)

Non stock packages:
Modsecurity 2.9.0
Fail2ban 0.9.1

Why use Slackware and not a hard float port?

A hardware floating-point unit you say, well I’d never heard of it.

ARMv7 includes a hardware floating-point unit (FPU), with improved speed compared to software-based floating-point.

In short, Slackware is not optimized for modern ARM implementations and it would be reasonable to assume that performance could be improved on a hard float port.

WordPress performance out of the box

It was not great truth to be told, page load times using the twenyfifteen theme clocked in at around 2.5 seconds on average (using 17 queries). I’ve always believed WordPress to be a “lightweight” application, but I guess that’s up for debate. Anyhow, I decided to try my hand at overclocking the RPi2 to see if I could improve performance to something more sustainable for production.

RPi2 final config:


I tried to push the arm_freq higher, but that caused the RPi2 to cough and crash under high load. Pushing the RPi2 to its limit sliced off another second of page load time, which was good, but obviously not comparable to commercial hosting. It was pretty much as expected, but it still felt like somewhat of a disappointment. However, since I rely heavily on caching with any WordPress installation, this RPi2 was not out of the game yet.

Optimizing the environment

By installing the “WP Super Cache” plugin from Automattic, and optimizing Apache for serving cached and compressed content, the RPi2 turned into a regular powerhouse.

Latest Performance Report for:
Latest Performance Report for:

Analyzing the performance over at gave me a page speed score of 96% and a YSlow grade of 92%. That’s a decent result on any platform and I’m rather impressed with the performance of the Raspberry Pi 2 in that regard.

The fact that the RPi2 is sitting on my desk while being assigned a dynamic IP, instead of cooling off at a high tech data center  with next to unlimited bandwidth makes it even more enjoyable.

I have one sour note though, compiling software is painfully slow, but that should not come as a huge surprise.


This site will keep rolling on Raspberry Pi 2 and Slackware ARM until something breaks beyond repair. As Slackware current is ripe for an avalanche of updates that might be sooner than later. If that should be the case, then I’ll update the changelog with the latest turn of events.

Slackware ARM current hosting
Slackware ARM current – Now hosting