{"id":1199,"date":"2021-04-07T16:05:42","date_gmt":"2021-04-07T13:05:42","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1199"},"modified":"2022-03-09T14:35:07","modified_gmt":"2022-03-09T12:35:07","slug":"what-is-my-mysql-server-hostname","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/what-is-my-mysql-server-hostname\/","title":{"rendered":"What is My MySQL Server Hostname?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Like humans, computers also require unique names to be individually addressed. These unique addresses enable them to communicate with each other on a network and share files.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The names also help people identify<\/span><b> the individual computers in a network.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The advent of the internet and the explosion in the number of connected computers have placed much need on hostnames. It assigns a uniquely identifiable name to each computer and also serves as an identification of <strong>where MySQL databases<\/strong><\/span><b> reside.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">This article will explore what a hostname is and how to find a <\/span><b>MySQL server hostname<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s get started.<\/span><\/p>\n<h2><b>What is a Server Hostname?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">A server hostname is a unique identifier that serves as the name of a host computer. It could consist of numbers and alphabets, and it\u2019s usually less than<\/span><b> 255 characters.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">IP addresses help identify computers and servers. These strings of numbers are not easily memorable, so hostnames assign names to these IP addresses so that people don\u2019t have to memorize those long numbers.<\/span><\/p>\n<p><b>They are name resolution for <\/b><a href=\"https:\/\/www.scalahosting.com\/blog\/how-to-manage-ip-addresses-on-your-vps\/\"><b>IP addresses<\/b><\/a><b>.<\/b><span style=\"font-weight: 400;\"> And they\u2019re not the same as a domain name.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The latter is the address people type in the browser when visiting the website. It consists of two or more labels. The left and right labels concatenate and a dot delimits them, for example, www.scalahosting.com.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The right-hand side label <\/span><i><span style=\"font-weight: 400;\">com<\/span><\/i><span style=\"font-weight: 400;\"> is the top-level domain, while the left label, <\/span><i><span style=\"font-weight: 400;\">scalahosting<\/span><\/i><span style=\"font-weight: 400;\"> is the sub-domain of <\/span><i><span style=\"font-weight: 400;\">com<\/span><\/i><span style=\"font-weight: 400;\">. Each label to the left delimited by a dot is a sub-domain of the domain to the right. Of course,<\/span><b> sub-domains are also domains but are subordinate to their parent domains.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The next component beyond these levels specifies<\/span><b> the host server.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">For instance, the <\/span><i><span style=\"font-weight: 400;\">www <\/span><\/i><span style=\"font-weight: 400;\">in our example denotes that the domain name is on a World Wide Web host server. <\/span><b>The hostname identifies the servers that connect to the WWW.\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">A hostname is a domain name with at least one associated IP address, but a valid domain name is not necessarily a valid hostname.<\/span><\/p>\n<h2><b>How to Find a MySQL Server Hostname<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">MySQL Server hostname defines the location of a MySQL database. Connecting to your database requires that you specify <\/span><b>the MySQL hostname to enable the program to know where to look.<\/b><\/p>\n<p>Let&#8217;s see how you can find your MySQL hostname.<\/p>\n<p><span style=\"font-weight: 400;\">The easiest way to find<\/span><b> your MySQL server hostname is by checking your phpMyAdmin web interface \u2014<\/b><span style=\"font-weight: 400;\"> phpMyAdmin is free software that helps people administer their MySQL and MariaDB databases through a browser-based graphic interface.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">And here\u2019s how to find you<\/span><b>r MySQL server hostname via phpMyAdmin.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Log in to your control panel. Below, you can see screenshots of ScalaHosting&#8217;s<\/span> <a href=\"https:\/\/www.scalahosting.com\/kb\/getting-started-with-spanel\/\"><span style=\"font-weight: 400;\">SPanel<\/span><\/a> &#8211; out proprietary all-in-one management platform designed for VPS solutions. In this case, you&#8217;ll need to log into SPanel&#8217;s User Interface<span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1201\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-5.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname\" width=\"343\" height=\"339\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-5.png 343w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-5-300x297.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">When logged in, locate the phpMyAdmin tool on the Databases section on the homepage.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1207\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image8-2.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 2\" width=\"510\" height=\"162\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image8-2.png 510w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image8-2-300x95.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">SPanel will log you in automatically.<br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Once you&#8217;re in in, you could see<\/span><b> the MySQL version on the panel\u2019s right side<\/b><span style=\"font-weight: 400;\">, under the Database Server section.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1205\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-3.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 3\" width=\"1347\" height=\"662\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-3.png 1347w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-3-300x147.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-3-1024x503.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-3-768x377.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s what you\u2019d see when you zoom into the right-hand panel of the above image.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1206\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image7-2.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 4\" width=\"427\" height=\"199\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image7-2.png 427w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image7-2-300x140.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">As you could see, the MySQL server hostname is <\/span><b>Localhost<\/b><span style=\"font-weight: 400;\">. Localhost means the MySQL database is running on the same server as the website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you use <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-create-a-wordpress-website-for-beginners\/\"><span style=\"font-weight: 400;\">WordPress<\/span><\/a><span style=\"font-weight: 400;\">, you can also check the MySQL database hostname in the <\/span><i><span style=\"font-weight: 400;\">wp-config.php<\/span><\/i><span style=\"font-weight: 400;\"> file.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s <\/span><b>how to locate this file.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Log in to your SPanel&#8217;s User Interface and open the <\/span><b>File manager<\/b><span style=\"font-weight: 400;\"> located under the Files section.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1203\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-5.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 5\" width=\"752\" height=\"220\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-5.png 752w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-5-300x88.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Click on the <\/span><b>public_html <\/b><span style=\"font-weight: 400;\">folder to open the files in this directory.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1200\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-5.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 6\" width=\"196\" height=\"389\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-5.png 196w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-5-151x300.png 151w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Scroll down until you locate the <\/span><b>wp-config.php<\/b><span style=\"font-weight: 400;\"> file and click on it and select <\/span><b>Edit<\/b><span style=\"font-weight: 400;\"> to open the file.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1202\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-5.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 7\" width=\"280\" height=\"420\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-5.png 280w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-5-200x300.png 200w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">You\u2019ll see the server hostname under <\/span><b>\/** MySQL hostname *\/<\/b><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1204\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-4.png\" alt=\"What is My MySQL Server Hostname?, How to Find a MySQL Server Hostname 8\" width=\"538\" height=\"242\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-4.png 538w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-4-300x135.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, the hostname is <\/span><b>\u201cLocalhost.\u201d<\/b><\/p>\n<h2><b>Wrapping It Up<\/b><\/h2>\n<p>In most cases the website&#8217;s files and its databases are hosted on the same server. That&#8217;s why, you often see <strong>localhost<\/strong> as the hostname for the MySQL server. However, sometimes, you may end up with a setup that needs a separate machine for the databases. In such cases, it&#8217;s a good idea to know where to find the hostname.<\/p>\n<p><span style=\"font-weight: 400;\">Feel free to contact our technical support specialists if you have any further problems locating it.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like humans, computers also require unique names to be individually addressed. These unique addresses enable them to communicate with each other on a network and share files.\u00a0 The names also help people identify the individual computers in a network. The advent of the internet and the explosion in the number of connected computers have placed [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1199","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1199"}],"version-history":[{"count":2,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1199\/revisions"}],"predecessor-version":[{"id":3797,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1199\/revisions\/3797"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}