找到你要的答案

Q:CONVERT_TZ function not working: Time zone data for MySQL

Q:convert_tz功能不工作:mysql时区数据

I am trying to use the CONVERT_TZ in MySQL. From what i have looked up the time_zone tables in the mysql schema need to be populated. I have looked this up on many different site and followed a few tutorials including this tutorial but the tables are still not populated

The 15 timezone files have been added to my C:\Program Files\MySQL\MySQL Server 5.6\data\mysql directory.I have tried both to add these files manually and use the mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql as seen here. I have restarted the MySQL service but the tables have still not been updated both ways

Does any have any ideas why?

我试图在MySQL中使用convert_tz。我已经查阅了MySQL架构的time_zone表需要被填充。我已经在许多不同的网站上看过了,并遵循了一些教程,包括本教程,但表仍然没有填充

15个时区的文件已被添加到我的C:\程序文件\ \ MySQL服务器MySQL 5.6 \data\spxxglxt MySQL目录。我一直都把这些文件手动和使用mysql_tzinfo_to_sql / usr /分享/中经银讯| MySQL U根P MySQL看这里。我已经重新启动mysql服务但表尚未更新的方法

有什么想法吗?

answer1: 回答1:

Solution :

I found the answer to this here. It seemed that even do I had a folder structure of C:\Program Files\MySQL\MySQL Server 5.6 when i ran the command show variables like 'datadir in MySQL it was pointing to C:\ProgramData\MySQL\MySQL Server 5.6 which is a hidden folder so i did not see it before

When i added the timezone files to C:\ProgramData\MySQL\MySQL Server 5.6\data\mysql it worked

解决方案:

我在这里找到了答案。看来,即使我有一个C的文件夹结构:程序文件\ \ MySQL服务器MySQL 5.6当我跑命令显示变量的datadir MySQL是指向C:\ \ \下MySQL的MySQL服务器5.6这是一个隐藏的文件夹,我之前没有看到它

当我添加的时区文件C:\ \ \下MySQL的MySQL服务器5.6 \data\spxxglxt MySQL工作

mysql  sql  timezone  convert-tz