trino查询mysql报Unknown or incorrect time zone: ‘Asia/Shanghai‘
问题
trino查询mysql时报Error listing schemas for catalog mysql: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
,trino的日志中看到Unknown or incorrect time zone: 'Asia/Shanghai'
解决
在mysql中设置SET GLOBAL time_zone = 'Asia/Shanghai'
但是会报Unknown or incorrect time zone: 'Asia/Shanghai'
。
此时需要到https://dev.mysql.com/downloads/timezones.html下载时区文件
解压后会得到一个sql文件,然后在mysql中use mysql; source 该sql文件路径
然后再重新在mysql中SET GLOBAL time_zone = 'Asia/Shanghai';
就行了