{"id":3078,"date":"2014-01-23T20:35:38","date_gmt":"2014-01-24T01:35:38","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2014\/01\/23\/find-database-name\/"},"modified":"2023-10-12T15:18:50","modified_gmt":"2023-10-12T19:18:50","slug":"find-database-name","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/","title":{"rendered":"309: Locating your database name in Drupal"},"content":{"rendered":"<p>There may come a time where you will need to know your specific database name for your Drupal website. Perhaps you need to connect to it via a remote MySQL program to take a look at some tables, or maybe you are in the middle of transferring a site and need to know what database to move.<\/p>\n\n\n\n<p>If you used an autoinstaller such as <a href=\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/softaculous\/\">Softaculous<\/a> to install Drupal you may have used the default database name and not paid much attention to it. You may also not have been the person to initially set up the site and have never seen the database name.<\/p>\n\n\n\n<p>If your hosting account has only one database in it, finding the name will not be an issue, but if you have multiple databases installed on the account, narrowing down which one is in use for your specific Drupal site can be more difficult. In this article, we will describe how to find the name of the database that your Drupal 8 site is using.<\/p>\n\n\n\n<p class=\"alert alert-info\">Focus on building your website with our optimized <a href=\"https:\/\/www.inmotionhosting.com\/drupal-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">Drupal Hosting<\/a>.<\/p>\n\n<h2>How to find your Drupal database name<\/h2>\n<ol class=\"article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into your cPanel dashboard<\/a>.\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<li>From the main cPanel page, locate the <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\"><strong>File Manager<\/strong><\/a> tool under the <em>Files<\/em> category and click on it.\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<li>Now that you are in the <em>File Manager<\/em>, you will need to access the root folder for your Drupal site. This can be different depending on whether your Drupal is installed as your main domain, an addon domain, or a sub domain. Below is a table to give you the format of the folder you will need to look for. The vast majority will be using the main domain, followed by addon, and the least likely subdomain.<br>\n<table class=\"article_table\">\n<tbody>\n<tr>\n<th>main site<\/th>\n<td><em>public_html<\/em><\/td>\n<\/tr>\n<tr>\n<th>addon domain<\/th>\n<td><em>public_html\/example.com<\/em><\/td>\n<\/tr>\n<tr>\n<th>subdomain<\/th>\n<td><em>public_html\/folder<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<li>Once you have found your root folder and opened it, you will need to look for the configuration file. This is located under the <strong>sites<\/strong> and then <strong>default<\/strong> folders. Assuming that Drupal is installed on your main site, you would need to look under the \u201c<em>public_html\/sites\/default<\/em>\u201d folder path. Once you have opened the <em>default<\/em> folder, look for a file named <strong>settings.php<\/strong>. <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-edit-a-file\/\">Open the file in edit mode<\/a>.\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<li><a href=\"\/support\/images\/stories\/edu\/Drupal-8\/309\/settings-php.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 0px 15px 15px;\" title=\"Click here to view the larger image\" src=\"\/support\/images\/stories\/edu\/Drupal-8\/309\/settings-php.png\" alt=\"Settings.php file\" width=\"200\"><\/a>\n<p>Once in the editor you will need to find the actual lines that have the database settings. The vast majority of the lines are commented out, so look towards the bottom of the file. You will see a line of code that appears like this:<\/p>\n<div class=\"code_block\">\u2018database\u2019 =&gt; \u2018userna5_testdb\u2019,<\/div>\n<p>The database name itself has two portions. The first portion \u2018<em>userna5<\/em>\u2018 is your cPanel username and the second part \u2018<em>testdb<\/em>\u2018 is the actual database name.<\/p>\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<li>Once you find the database name, be sure to notate it in a safe place so it is easily found when you need it. This will be most commonly useful when working with database admin programs such as phpMyAdmin or remote database connection managers.\n<div style=\"clear: both;\">\u00a0<\/div>\n<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>There may come a time where you will need to know your specific database name for your Drupal website. Perhaps you need to connect to it via a remote MySQL program to take a look at some tables, or maybe you are in the middle of transferring a site and need to know what database<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[372],"tags":[],"class_list":["post-3078","post","type-post","status-publish","format-standard","hentry","category-drupal"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>309: Locating your database name in Drupal | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to find your Drupal database name via cPanel.\" \/>\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.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"309: Locating your database name in Drupal | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to find your Drupal database name via cPanel.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-24T01:35:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-12T19:18:50+00:00\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Scott Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"309: Locating your database name in Drupal\",\"datePublished\":\"2014-01-24T01:35:38+00:00\",\"dateModified\":\"2023-10-12T19:18:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\"},\"wordCount\":494,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Drupal\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\",\"name\":\"309: Locating your database name in Drupal | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2014-01-24T01:35:38+00:00\",\"dateModified\":\"2023-10-12T19:18:50+00:00\",\"description\":\"Learn how to find your Drupal database name via cPanel.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"309: Locating your database name in Drupal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"309: Locating your database name in Drupal | InMotion Hosting","description":"Learn how to find your Drupal database name via cPanel.","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.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/","og_locale":"en_US","og_type":"article","og_title":"309: Locating your database name in Drupal | InMotion Hosting","og_description":"Learn how to find your Drupal database name via cPanel.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2014-01-24T01:35:38+00:00","article_modified_time":"2023-10-12T19:18:50+00:00","author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"309: Locating your database name in Drupal","datePublished":"2014-01-24T01:35:38+00:00","dateModified":"2023-10-12T19:18:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/"},"wordCount":494,"commentCount":2,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Drupal"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/","name":"309: Locating your database name in Drupal | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2014-01-24T01:35:38+00:00","dateModified":"2023-10-12T19:18:50+00:00","description":"Learn how to find your Drupal database name via cPanel.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/find-database-name\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"309: Locating your database name in Drupal"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3078"}],"version-history":[{"count":6,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3078\/revisions"}],"predecessor-version":[{"id":107020,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3078\/revisions\/107020"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}