mySQL connection with JDBC driver and timezone error
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Arpan Badeka
on 22 Aug 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
0 Comments
See Also
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!