Azzera filtri
Azzera filtri

mySQL connection with JDBC driver and timezone error

9 visualizzazioni (ultimi 30 giorni)
Hey,
I need to connect to a mySQL database of my university which is unfortunately configured with a unrecognized timezone "CEST" what is pointed out by the JDBC driver assistant. NOw I need to set driver parameters for a timezone in MATLAB somewhat like that:
>> conn = database('test', 'user', 'pw', 'driver', 'com.mysql.cj.jdbc.Driver', 'url', '?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC')
As a response I get "No timezone mapping entry ...". What am I doing wrong? I can connect through dBeaver with a timezone setting though.
Thanks!
PS. Can somebody show me a complete script to connect to a JDBC database? How do I select the driver? etc.

Risposte (1)

Arpan Badeka
Arpan Badeka il 22 Ago 2019
Hi,
Use something similar to the following command to fix the issue:
>> conn = database('',<username>,<password>,'com.mysql.cj.jdbc.Driver','jdbc:mysql://servername:portnumber/databasename?serverTimezone=UTC&')
Other approach is to configure the MySQL server to set a recognized timezone.
Thanks

Prodotti


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by