{"id":24464,"date":"2022-02-02T14:36:38","date_gmt":"2022-02-02T14:36:38","guid":{"rendered":"https:\/\/1-grid.com\/knowledge\/how-to-connect-to-the-mysql-server\/"},"modified":"2023-11-14T09:25:13","modified_gmt":"2023-11-14T09:25:13","slug":"how-to-connect-to-the-mysql-server","status":"publish","type":"ht_kb","link":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/","title":{"rendered":"How to connect to the MySQL server"},"content":{"rendered":"<blockquote><p><span style=\"color: #000000;\"><span lang=\"EN-US\" style=\"font-family: Helvetica, sans-serif;\" data-contrast=\"none\">This guide explains what settings to use to connect to the MySQL server.<\/span><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">MySQL is a popular relational database management system used in various applications and web services. However, on cPanel shared servers, the MySQL port 3306 is locked down to local access only, which means that connecting to the MySQL server from remote locations is not straightforward.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This article will provide you with the necessary information to establish a local MySQL connection.<\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\">MySQL port 3306 is locked down (local access only) on all our cPanel shared servers. This will effectively mean that customers can&#8217;t access MySQL with tools like MySQL Workbench\/Heidi SQL from a remote locations.<\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\"><strong><span style=\"font-size: 18px;\">Why:\u00a0<\/span><\/strong><\/span><\/p>\n<ul>\n<li><span style=\"font-family: Helvetica, sans-serif; color: #000000;\">Due to the ever increasing vulnerabilities and the risk attached to these have decided to lock down MySQL to local access only.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\"><span style=\"font-size: 18px;\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\"><strong>Setting up a local MySQL connection via script van be done as per below:<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\"><span lang=\"EN-US\" data-contrast=\"none\">Configuration Settings<\/span><span lang=\"EN-US\" data-contrast=\"none\">:<\/span><br \/>\n<span lang=\"EN-US\" data-contrast=\"none\">Host = localhost (really, put localhost)<\/span><br \/>\n<span lang=\"EN-US\" data-contrast=\"none\">Database name = (<\/span><span lang=\"EN-US\" data-contrast=\"none\">cpanelusername_databasename<\/span><span lang=\"EN-US\" data-contrast=\"none\">)<\/span><br \/>\n<span lang=\"EN-US\" data-contrast=\"none\">Database username = (<\/span><span lang=\"EN-US\" data-contrast=\"none\">cpanelusername_databaseusername<\/span><span lang=\"EN-US\" data-contrast=\"none\">)<\/span><br \/>\n<span lang=\"EN-US\" data-contrast=\"none\">Database password = (******)<\/span>\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\">\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\"><span lang=\"EN-US\" data-contrast=\"none\"><strong>INFO:<\/strong><\/span><span lang=\"EN-US\" data-contrast=\"none\"><strong>\u202f<\/strong>When you move databases to our servers, the database name and username may change. This change must be updated in your script code. (The database name and username is clearly displayed in\u00a0<\/span><span lang=\"EN-US\" data-contrast=\"none\">cPanel<\/span><span lang=\"EN-US\" data-contrast=\"none\">, in the MySQL area.)<\/span>\u00a0<\/span><\/p>\n<p><span style=\"font-family: Helvetica,sans-serif;\"><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide explains what settings to use to connect to the MySQL server.\u00a0 MySQL is a popular relational database management system used in various applications and web services. However, on cPanel shared servers, the MySQL port 3306 is locked down to local access only, which means that connecting to the&#8230;<\/p>\n","protected":false},"author":21,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[1174],"ht-kb-tag":[222,470,480,662,898,1003,1024],"class_list":["post-24464","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hosting","ht_kb_tag-connect","ht_kb_tag-hosting","ht_kb_tag-how-to","ht_kb_tag-mysql","ht_kb_tag-server","ht_kb_tag-the","ht_kb_tag-to"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to connect to the MySQL server - 1-grid Knowledge Base<\/title>\n<meta name=\"description\" content=\"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to connect to the MySQL server - 1-grid Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base\" \/>\n<meta property=\"og:url\" content=\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"1-grid Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/1grid.co.za\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-14T09:25:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@1grid_hosting\" \/>\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:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/\",\"name\":\"How to connect to the MySQL server - 1-grid Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\"},\"datePublished\":\"2022-02-02T14:36:38+00:00\",\"dateModified\":\"2023-11-14T09:25:13+00:00\",\"description\":\"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base\",\"breadcrumb\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/1grid.co.za\/knowledge\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to connect to the MySQL server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"contentUrl\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"width\":100,\"height\":100,\"caption\":\"1-Grid Domain Hosting Knowledge Base\"},\"image\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/1grid.co.za\/\",\"https:\/\/twitter.com\/1grid_hosting\",\"https:\/\/www.instagram.com\/1grid_hosting\/\",\"https:\/\/za.linkedin.com\/company\/1-grid\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to connect to the MySQL server - 1-grid Knowledge Base","description":"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base","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:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/","og_locale":"en_US","og_type":"article","og_title":"How to connect to the MySQL server - 1-grid Knowledge Base","og_description":"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base","og_url":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/","og_site_name":"1-grid Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/1grid.co.za\/","article_modified_time":"2023-11-14T09:25:13+00:00","twitter_card":"summary_large_image","twitter_site":"@1grid_hosting","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/","url":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/","name":"How to connect to the MySQL server - 1-grid Knowledge Base","isPartOf":{"@id":"https:\/\/1grid.co.za\/knowledge\/#website"},"datePublished":"2022-02-02T14:36:38+00:00","dateModified":"2023-11-14T09:25:13+00:00","description":"This guide explains what settings to use to connect to the MySQL server. How to connect to the MySQL server 1-grid Knowledge Base","breadcrumb":{"@id":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/1grid.co.za\/knowledge\/how-to-connect-to-the-mysql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/1grid.co.za\/knowledge\/"},{"@type":"ListItem","position":2,"name":"How to connect to the MySQL server"}]},{"@type":"WebSite","@id":"https:\/\/1grid.co.za\/knowledge\/#website","url":"https:\/\/1grid.co.za\/knowledge\/","name":"1-Grid Domain Hosting Knowledge Base","description":"","publisher":{"@id":"https:\/\/1grid.co.za\/knowledge\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/1grid.co.za\/knowledge\/#organization","name":"1-Grid Domain Hosting Knowledge Base","url":"https:\/\/1grid.co.za\/knowledge\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/","url":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","contentUrl":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","width":100,"height":100,"caption":"1-Grid Domain Hosting Knowledge Base"},"image":{"@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/1grid.co.za\/","https:\/\/twitter.com\/1grid_hosting","https:\/\/www.instagram.com\/1grid_hosting\/","https:\/\/za.linkedin.com\/company\/1-grid"]}]}},"_links":{"self":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/comments?post=24464"}],"version-history":[{"count":3,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24464\/revisions"}],"predecessor-version":[{"id":33051,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24464\/revisions\/33051"}],"wp:attachment":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/media?parent=24464"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-category?post=24464"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-tag?post=24464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}