从phpMyAdmin更改mysql时区 [英] Change mysql timezone from phpMyAdmin
问题描述
我正在尝试更改数据库的时区.我在共享服务器上,数据库支持人员不能只为我更改它.当前时区为+1:00
,我希望它为+05:30
.我进行了搜索并尝试了以下操作,但没有任何效果.
I am trying to change the timezone of my database. I am on shared server and database support guys can not change it for me only. Time zone is currently +1:00
I want it as +05:30
. I searched and tried following but nothing worked.
date_default_timezone_set('timezone_name');
已添加到我的index.php
文件中.
mysql> SET GLOBAL time_zone = 'timezone_name';
显示访问受限.
SET time_zone = timezone_name
查询运行现在受行影响.
Query run now row affected.
我的网站托管在以地面为基础的美国服务器上.
My site is hosted on site-ground us server.
推荐答案
就像我在共享服务器上一样,我的提供者并没有只为我更改它.因此,在搜索后我发现,我必须在sql上使用datetime
类型而不是当前时间戳,并且正如madipradhana所说,我已经更新了php.ini
或.htaccess
.
As I am on shared server my provider did not change it only for me. So after search I fount that, I have to use datetime
type on sql instead of current time stamp and as madipradhana said I was updated my php.ini
or .htaccess
.
这篇关于从phpMyAdmin更改mysql时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!