In order to connect to a database over MySQL JDBC driver which complains about the timezone, I need to set serverTimezone variable over mydbname?serverTimezone="Europe/Vienna".
Steps to Reproduce:
1. Open LibreOffice Base
2. Configure a MySQL server over JDBC driver
3. Pass in ?serverTimezone="Europe/Vienna" as a database name parameter
Libreoffice Base connects to the DBMS successfully, however, after pressing OK in the Database Properties window, the the Name of the MySQL database string gets changed to Vienna. Looks like someone is using a split() function which filters out all "/" characters and returns the part after "/".
Should not change the database name string.
User Profile Reset: No
I would suggest having something like escaping functionality, so that I can say "Europe/Vienna" without getting the "/" inside of "" filtered out.
Anyway, the connection works, so if this is a security feature, then it is a bad one, because it works one time, which is enough for a potential attack. The problem occurs the next time you open the saved libreoffice base file, when it tries to connect to the database name containing substring after "/".
Created attachment 144773 [details]
libreoffice changing databasename string
Here how it looks like
@Lars: did this work correctly in previous versions ? If so, which ones ?
Confirming with LO 6062 MacOS 10.13.6
Impossible to debug without fixing tdf#119850 first.
I would add that this bug also makes it impossible to use the latest mysql-connector-jar (8.0.12) as each time an attempt to load any tables containing timestamp fields is made an error message is produced:
"The server time zone value CEST is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimeZone configuration property) to use a more specific time zone value if you want to utilize time zone support."
Note that adding the string :
as can be found in other similar jdbc issues on the internet such as stackoverflow allows a workaround, however then no account is taken of local time at the point of entry by the user.
*** Bug 120123 has been marked as a duplicate of this bug. ***
I'm not sure to understand, do you use Mysql then Jdbc or JDBC directly?
If Mysql then JDBC, I got an error message when adding "?serverTimezone="Europe/Vienna" to the database name.
For JDBC directly, i installed MariaDbServer + phpmyadmin, it worked.
I installed libmariadb-java and added this archive in Classpath.
Then I tried to test the driver with org.mariadb.jdbc.Driver, LO said it couldn't load the driver.
(In reply to Julien Nabet from comment #8)
> For JDBC directly, i installed MariaDbServer + phpmyadmin, it worked.
> I installed libmariadb-java and added this archive in Classpath.
> Then I tried to test the driver with org.mariadb.jdbc.Driver, LO said it
> couldn't load the driver.
Forget my last comment, the test of class loading is ok. It seems I clicked "Cancel" when adding the jar since the archive wasn't here.
I used this string for connection:
and I could open the tables of "btuc" database.
In edit/database, I got:
- Connection type...
- Advanced Settings...
In Properties, I can change DataSource URL, User auth, JDBC Properties, Test Class, Test connection
what should I do then?
Where is "Name of the MYSQL Database"?
(In reply to Julien Nabet from comment #10)
> Where is "Name of the MYSQL Database"?
The name of the database as it is displayed at the bottom of the main ODB window when you open the ODB file in LO.
The setup where I could reproduce was first choose JDBC in connection, wizard, then enter the connection string.
It seems that this might be limited to mysql connector JAR / mysql server configurations.
On pc Debian x86-64 with master sources updated today + MariaDB server 10.3.13 + MariaDB connector JDBC 2.4.0, I don't reproduce this.
Here what I did:
- put "mysql://localhost/test?serverTimezone=Europe/Vienna" in database/properties/jdbc string.
- clicked "OK"
- At bottom center of my LO window, I can see: