0

Linux Mint 20 (Ubuntu 20).

MariaDB version: "mariadb Ver 15.1 Distrib 10.7.3-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2"

LibreOffice 6.4.7.2.

I want to run LibreOffice Base as the front end, using ODBC. I previously had MySQL installed in this OS and managed to get ODBC working for LibreOffice Base. Now I have removed MySQL and installed MariaDB.

Incidentally, I am now beginning to wonder whether this a LibreOffice glitch. Wouldn't be the first. Any successful experience of getting ODBC to work with MariaDB (specifically) in Linux could be helpful. Though in fact I seem possibly to have got it working in fact (see below: isql with my configured DSN works!).

I have tried to follow the MariaDB instructions here.

I have put the file libmaodbc.so in /usr/lib64/. I believe this is the main connector file.

I have made a file /etc/odbcinst.ini as follows:

[MariaDB]
Description=MariaDB Connector/ODBC v.3.0
Driver=/usr/lib/libmaodbc.so
Driver64=/usr/lib64/libmaodbc.so
UsageCount=1

and a file /etc/odbc.ini as follows:

[localdb]
Description           = MariaDB connection to  database
Driver                = MariaDB
Database              = localdb
Server                = localhost
User                  = user_mike
Password              = user_mike
Port                  = 3306
Socket                = /var/run/mysqld/mysqld.sock

When I try to connect using LO Base, this ODBC entry "localdb" is seen. But then when I test out the connection I get:

[unixODBC][Driver Manager]Data source name not found, and no default driver specified

"Data source name"? But I chose the DSN. "default driver"? How might I specify that, I wonder!

Anyone know what I should do? My theory is that the odbc.ini file references the odbcinst.ini file, which in turn drives the libmaodbc.so file.

NB if I go as far as trying to actually make the connection, i.e. to get a list of tables in the database in LO Base, I get

The connection to the data source "xxx"* could not be established
[ma-3.1.15]Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (13)

* i.e. the LO Base filename minus the ".odb" extension.

I found this answer. This led me to check my .cnf file(s), NB under /etc/mysql...

And also to check my socket (with the MariaDB service running):

mike@M17A:~/MariaDB_files$ netstat -ln | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     263752   /var/run/mysqld/mysqld.sock

... interesting: seems to suggest that the socket is alive and well.

Also I can connect using isql localdb from the CLI: doesn't this suggest things are set up OK?

So what might be the issue?

13
  • Would it help if you replaced "Server = localhost" by "SERVER=localhost" and so for the other parameters too, as specified by mariadb.com/kb/en/… ? Apr 4, 2022 at 10:54
  • FYI: my location for the library is /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so. Apr 4, 2022 at 13:05
  • Thanks... tried both of those: no joy. Interestingly, /usr/lib/x86_64-linux-gnu/odbc did already exist, with various files in it. I copied the (hopefully) 64-bit version of libmaodbc.so there, adjusted odbcinst.ini accordingly... still no change. Apr 4, 2022 at 18:53
  • The 13 in Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (13) by running perror 13 indicates a permission denied
    – danblack
    Apr 4, 2022 at 23:13
  • Thanks, that's useful to know. I'll do some research into how I might try to do something about that. Apr 5, 2022 at 7:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.