You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. At sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method). How to create a data connection in PhpStorm, create SSH and SSL connections, change a search path, create database connections. Www.jetbrains.com 寻找官方有关于 MySQL 数据库的配置教程,依照步骤配置即可。. This is just a guess, but I suspect mysql -u a of connecting via localhost because when the connection protocol is not specified, the default is to connect via the socket file. There may exist an entry in mysql.user that allow anonymous localhost connection. Run this query: SELECT user,host,password FROM mysql.user WHERE user=' AND host.
If you are using a java app that tries to connect to a MySQL/MariaDB database and gets this error:
java.sql.SQLException: The server timezone value 'UTC' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want to utilize timezone support.
it seems that the app is not sending the correct timezone params, you might want to add this to the connection string:
- In different words, simply setting serverTimezone=UTC with a different time zone on the database server will shift any dates extracted from the database; The MySQL default time zone can be set to UTC+0 with the my.ini or my.cnf files (windows / linux respectively) by adding the line default-time-zone='+00:00' (details in this StackOverflow post).
- QUESTION UPDATE: I had mistakenly used the revision number for PHPStorm. The correct version is 2017.1, not 2017.3 as initially stated. I recently updated to the latest PHPStorm (2017.1 March).
jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
Note that just passing serverTimezone=UTC
fixed the problem, but it might require the other params.
Datagrid
Mysql Servertimezone Asia Shanghai
With datagrid I was getting another connection error, that it tried to connect 3 times and the server didn't respond, I applied the same fix and it worked