How to connect libreoffice client to mysql on server

Good morning,
After installing mysql/workbench on our win2019 server I tryed to connect to it from my workstation/LO/database wizard/“Connect to an existing database”, using ODBC, but don’t know what to enter in the “Name of odbc data source on your system”
Thank you

Why do you use ODBC? Try the direct connection.

See
https://books.libreoffice.org/en/BG73/BG7302-CreatingADatabase.html#toc9
for the connections types: ODBC, JDBC and direct connection.

1 Like

You can check the name of the odbc data source by going to the ODBC control panel

1 Like

I sent all day on this. I was able to install the odbc driver on my server but when i tryed to do the same on my win7P workstation it said ot needed visual studio, the .net something, then could only find 2022 version which is incompatible with win7P!
So that was a dead end.
I’ll read your link robert. Tu

I have no idea how to find the odbc control panel.
Tu

How do i create a direct connection?

Nevermind, found “data sources (odbc)” but it only has sql server under system dsn. It wouldn’t let me install mysql driver

Start the database wizard.

  1. Step: Connect to an existing database → MySQL/MariaDB
  2. Step: Connect directly (you could choose ODBC, JDBC and connect directly here.
    Send screenshot if you won’t find the right entry.
1 Like

Ok, i followed the link instructions for mysql/maria and was able to get my first successful connection!!! What a great feeling!
Unfortunately, I missed the part about not registering it, can i reverse that, does it matter?

Also, i created a table and form in LO base. How do i move to workbench? I tryed earlier in the week but was unsuccessful.
Thank you

Register database: You could set this in Tools → Options → LibreOffice Base → Databases. There might be the database Bibliography as registered Name. If you have registered the database you could better connect to the database from Writer or Calc. If you will only use Base it isn’t needed to register a database. I don’t register databases when creating a database. I will only register the database if I need a connection from one database to another database or from Writer or Calc to the database.

You could chose the database you won’t register and could delete the entry. This doesen’t deleted the Base file, only the link to your Base file for Writer, Calc or other databases.

You MySQL workbench is a separate application for administration work on MySQL. You can’t connect from a Base file to the workbench. You could create tables in both applications and could work with this tables in both applications. I don’t use workbench here. I’m using phpMyAdmin together with a webserver on Linux instead.

1 Like

So if I want to use mysql for it’s ability to give me individual field privileges, something libreoffice base can’t do, i should create my table first in mysql/workbench, then connect LO base to it to make my forms, reports etc. ?
Tu

Yes, use MySql Workbench for setting up your tables, triggers, user privileges, procedures, etc, then LOBase for forms, queries, reports.

1 Like

Hi Iplaw,
I seems no matter how hard i try, or all advice i get that it can be done, I can’t import the database/table i created in Lo base into workbench. ( too bad cause i put a lot time in on it)
So I’ll start over hoping this works.

I created an empty database in workbench named WorkOrders, then the 12 fields i need for my table and Lo form.
To see if i can connect this table to a new Lo base form, i made all the fields, except two date fields, varchar45.
Once I’m certain i can do that i come back and adjust the varchar’s to different sizes.

If thT works, should i change default/expressions in the table or form?

I was told i can’t get individual field security in LO, which is why i am using mysql. Do you know where it is or how to do it?

If you have created a table with Base in a MySQL database it should also be available in MySQL Workbench. Both connect to the same data source. Might be it doesn’t appear directly. In Base you could refresh the tables view by View → Refresh Tables. Sen a screenshot of the opened database in MySQL Workbench and another of Base connecting to this database.

1 Like

Hi R,
I created my first db/table in base with hsqldb (the only option), but could not export, open/connect, or get .sql or “dumps” to open or transfer to mysql.

On recommendations, abandoned that and made new db in mysql, with eventual hope of connecting base to it.
Creating it was successful but i can’t connect to it from LO.
(I’ve put LO and mysql both on my laptop for homework)
It keeps saying it can’t connect to ‘localhost’

I don’t know how to do pictures.

Thought you have really connected to MySQL/MariaDB. Seems I don’t understand right what you posted 2 days before.

You could upload screenshots with 7. symbol in this editor. Please show what you choose in LibreOffice when you try to create a database, which connects to MySQL.

1 Like

The book.libreoffice.org, mysql/mariadb database test connect (libretest db, lotest user, libre password) worked at work over the Lan but i could not connect my LibreOffice workorder/db there.

I wanted to keep working at home so i tryed the same libretest test here but it wont accept “localhost” or anything in server connection.

Thats why i built a new db right in mysql/workbench this morning but i can connect, it has th same server not found error.

Update:
I noticed my workorder schema had no grants so i added a user and password with all rights. Closed out all apps, restarted entered new user/pass but got the same "can’t connect to server on ‘localhost’ (10061)

It will work with “localhost”, if MySQL/MariaDB is installed at the same computer.
It will work with an IP, when it is installed an another place in the lan, like 192.168.0.1
It will work with a complete address with URL, if the database is connected from you trough www.
You could also connect by an ssh-tunnel to another place, but you will need ssh working on both places - server and client.

So: Where is you MySQL/MariaDB database?

1 Like

Its on my laptop with libreoffice? Maybe thats the problem, both cant be on same device?

If both are on the same device it should work with “localhost”. Which system do you use? Has server for MySQL/MariaDB been started?

1 Like