{"id":7415,"date":"2019-04-18T16:34:40","date_gmt":"2019-04-18T16:34:40","guid":{"rendered":"https:\/\/www.siliconhouse.net\/support\/?page_id=7415"},"modified":"2019-04-18T16:34:42","modified_gmt":"2019-04-18T16:34:42","slug":"changemysqltimezone","status":"publish","type":"page","link":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/","title":{"rendered":"How to Change MySQL Server Time Zone in Dedicated Server ?"},"content":{"rendered":"\n<p>To change the time zone of your MySQL server, please follow the below steps.<\/p>\n\n\n<p><aside id=\"text-16\" class=\"widget widget_text amr_widget\">\t\t\t<div class=\"textwidget\"><div class=\"reseller_web_hosting_support_advts\">\r\n\r\n<div class=\"reseller_web_hosting_support_advts_left\">\r\n<a href=\"https:\/\/www.siliconhouse.net\/linux-reseller-web-hosting-india\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/www.siliconhouse.net\/wp-content\/uploads\/2018\/06\/336X280-saffron-unlimited-499-kickstart.gif\" width=\"336\" height=\"280\" alt=\"Reseller Hosting Special Offer\"><\/a>\r\n<\/div>\r\n\r\n<div class=\"reseller_web_hosting_support_advts_right\">\r\n<a href=\"https:\/\/www.siliconhouse.net\/linux-cloud-server-hosting-india\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/www.siliconhouse.net\/wp-content\/uploads\/2018\/06\/336X280-purple-enterprise-cloud-stak-19.jpg\" width=\"336\" height=\"280\" alt=\"Enterprise Cloud Stack\"><\/a>\r\n<\/div>\r\n\r\n<\/div><\/div>\n\t\t<\/aside> <aside id=\"text-20\" class=\"extendedwopts-md-center widget widget_text amr_widget\">\t\t\t<div class=\"textwidget\"><div class=\"reseller_web_hosting_support_advts\">\r\n<div class=\"reseller_web_hosting_support_advts_left\">\r\n<img decoding=\"async\" border=\"0\" src=\"http:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/12\/reseller-hosting-249-offer.gif\" width=\"320\" height=\"100\" alt=\"Reseller Hosting Special Offer\">\r\n<\/div>\r\n\r\n<div class=\"reseller_web_hosting_support_advts_right\">\r\n<img decoding=\"async\" border=\"0\" src=\"http:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/12\/reseller-hosting-249-offer.gif\" width=\"320\" height=\"100\" alt=\"Reseller Hosting Special Offer\">\r\n<\/div>\r\n\r\n<\/div><\/div>\n\t\t<\/aside><\/p>\n\n\n\n<p>1)&nbsp;<a href=\"https:\/\/www.siliconhouse.net\/support\/dedicated-servers\/linux-dedicated-server-hosting\/login-dedicated-server-ssh-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Login to your server via SSH<\/a>&nbsp;as root user.<\/p>\n\n\n\n<p>2) You can find current MySQL server time zone via executing the following command.<\/p>\n\n\n\n<p><strong>mysql -e \u201cSELECT @@global.time_zone;\u201d<\/strong><\/p>\n\n\n\n<p>The output of the above command is something similar to the following:<\/p>\n\n\n\n<p><strong>@@global.time_zone<\/strong><\/p>\n\n\n\n<p><strong>SYSTEM<\/strong><\/p>\n\n\n\n<p>Here we can see that the MySQL time zone is set as \u201cSystem\u201d. Which means current MySQL time zone depends on the system time.<\/p>\n\n\n\n<p>By default, MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.<\/p>\n\n\n\n<p>3) You can check the server\u2019s current time using following command:<\/p>\n\n\n\n<p><strong>$ date<\/strong><\/p>\n\n\n\n<p>The date command will give back something similar to the following:<\/p>\n\n\n\n<p><strong>Thu Apr 18 21:42:04 IST 2019<\/strong><\/p>\n\n\n\n<p>4) You can check current timestamp using in MySQL by executing the following command:<\/p>\n\n\n\n<p><strong>$ mysql -e \u201cSELECT NOW();\u201d<\/strong><\/p>\n\n\n\n<p>The command will give back something like:<\/p>\n\n\n\n<p><strong>NOW()<\/strong><\/p>\n\n\n\n<p><strong>2019-04-18 21:42:04<\/strong><\/p>\n\n\n\n<p>5) You can change your MySQL time zone by editing MySQL configuration file (<a href=\"https:\/\/www.siliconhouse.net\/support\/dedicated-servers\/linux-dedicated-server-hosting\/change-root-password-mysql-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">\/etc\/my.cnf<\/a>). You need to open the config. file using your favorite text editor.<\/p>\n\n\n\n<p><strong>vi \/etc\/my.cnf<\/strong><\/p>\n\n\n\n<p>Then add the time zone details to the bottom of the configuration file. For example:<\/p>\n\n\n\n<p><strong>default-time-zone = \u2018-06:00\u2019<\/strong><\/p>\n\n\n\n<p>6) Run the following command to check if time zone has changed.<\/p>\n\n\n\n<p><strong>mysql -e \u201cSELECT @@global.time_zone;\u201d<\/strong><\/p>\n\n\n\n<p>7) You should also check with the NOW function.<\/p>\n\n\n\n<p><strong>mysql -e \u201cSELECT NOW();\u201d<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To change the time zone of your MySQL server, please follow the below steps. 1)&nbsp;Login to your server via SSH&nbsp;as<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-7415","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change MySQL Server Time Zone in Dedicated Server<\/title>\n<meta name=\"description\" content=\"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change MySQL Server Time Zone in Dedicated Server\" \/>\n<meta property=\"og:description\" content=\"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/\" \/>\n<meta property=\"og:site_name\" content=\"Silicon House - Reseller Hosting - Dedicated Servers - Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/siliconhouse.net\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-18T16:34:42+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@siliconhouse\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/\",\"url\":\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/\",\"name\":\"How to Change MySQL Server Time Zone in Dedicated Server\",\"isPartOf\":{\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#website\"},\"datePublished\":\"2019-04-18T16:34:40+00:00\",\"dateModified\":\"2019-04-18T16:34:42+00:00\",\"description\":\"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.siliconhouse.net\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change MySQL Server Time Zone in Dedicated Server ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#website\",\"url\":\"https:\/\/www.siliconhouse.net\/support\/\",\"name\":\"Silicon House - Reseller Hosting - Dedicated Servers - Cloud\",\"description\":\"Reseller Hosting - Dedicated Servers - Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.siliconhouse.net\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#organization\",\"name\":\"Silicon House\",\"url\":\"https:\/\/www.siliconhouse.net\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/10\/siliconhouse-logo.png\",\"contentUrl\":\"https:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/10\/siliconhouse-logo.png\",\"width\":42,\"height\":40,\"caption\":\"Silicon House\"},\"image\":{\"@id\":\"https:\/\/www.siliconhouse.net\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/siliconhouse.net\",\"https:\/\/x.com\/siliconhouse\",\"https:\/\/www.youtube.com\/siliconhouse\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change MySQL Server Time Zone in Dedicated Server","description":"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/","og_locale":"en_US","og_type":"article","og_title":"How to Change MySQL Server Time Zone in Dedicated Server","og_description":"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.","og_url":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/","og_site_name":"Silicon House - Reseller Hosting - Dedicated Servers - Cloud","article_publisher":"https:\/\/www.facebook.com\/siliconhouse.net","article_modified_time":"2019-04-18T16:34:42+00:00","twitter_card":"summary_large_image","twitter_site":"@siliconhouse","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/","url":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/","name":"How to Change MySQL Server Time Zone in Dedicated Server","isPartOf":{"@id":"https:\/\/www.siliconhouse.net\/support\/#website"},"datePublished":"2019-04-18T16:34:40+00:00","dateModified":"2019-04-18T16:34:42+00:00","description":"MySQL time zone will be set to the server\u2019s time zone. If you are interested in changing MySQL Time zone you can edit \/etc\/my.cnf configuration file.","breadcrumb":{"@id":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.siliconhouse.net\/support\/changemysqltimezone\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.siliconhouse.net\/support\/"},{"@type":"ListItem","position":2,"name":"How to Change MySQL Server Time Zone in Dedicated Server ?"}]},{"@type":"WebSite","@id":"https:\/\/www.siliconhouse.net\/support\/#website","url":"https:\/\/www.siliconhouse.net\/support\/","name":"Silicon House - Reseller Hosting - Dedicated Servers - Cloud","description":"Reseller Hosting - Dedicated Servers - Cloud","publisher":{"@id":"https:\/\/www.siliconhouse.net\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.siliconhouse.net\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.siliconhouse.net\/support\/#organization","name":"Silicon House","url":"https:\/\/www.siliconhouse.net\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.siliconhouse.net\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/10\/siliconhouse-logo.png","contentUrl":"https:\/\/www.siliconhouse.net\/support\/wp-content\/uploads\/2016\/10\/siliconhouse-logo.png","width":42,"height":40,"caption":"Silicon House"},"image":{"@id":"https:\/\/www.siliconhouse.net\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/siliconhouse.net","https:\/\/x.com\/siliconhouse","https:\/\/www.youtube.com\/siliconhouse"]}]}},"_links":{"self":[{"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/pages\/7415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/comments?post=7415"}],"version-history":[{"count":1,"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/pages\/7415\/revisions"}],"predecessor-version":[{"id":7416,"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/pages\/7415\/revisions\/7416"}],"wp:attachment":[{"href":"https:\/\/www.siliconhouse.net\/support\/wp-json\/wp\/v2\/media?parent=7415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}