{"id":142,"date":"2026-09-06T14:42:39","date_gmt":"2026-09-06T09:12:39","guid":{"rendered":"https:\/\/hostcrafter.com\/kb\/create-mysql-database\/"},"modified":"2026-09-06T17:36:33","modified_gmt":"2026-09-06T12:06:33","slug":"create-mysql-database","status":"publish","type":"post","link":"https:\/\/hostcrafter.com\/kb\/create-mysql-database\/","title":{"rendered":"How to Create a MySQL Database and Open phpMyAdmin"},"content":{"rendered":"<p><strong>If you are installing WordPress, you do not need to do any of this.<\/strong> WordPress gets its own database, its own user and its own password the moment you add the website. This page is for the other case: a script of your own that needs a database beside your WordPress sites, and for looking inside a database you already have.<\/p>\n<dl class=\"hc-facts\">\n<div>\n<dt>For WordPress<\/dt>\n<dd>Nothing to do. It is automatic<\/dd>\n<\/div>\n<div>\n<dt>Host<\/dt>\n<dd><code>localhost<\/code><\/dd>\n<\/div>\n<div>\n<dt>phpMyAdmin<\/dt>\n<dd>One click, no password to type<\/dd>\n<\/div>\n<div>\n<dt>Where<\/dt>\n<dd>Panel \u2192 Databases<\/dd>\n<\/div>\n<\/dl>\n<nav class=\"hc-toc\">\n<h2>On this page<\/h2>\n<ol>\n<li><a href=\"#look\">Look at What You Already Have<\/a><\/li>\n<li><a href=\"#phpmyadmin\">Open phpMyAdmin<\/a><\/li>\n<li><a href=\"#create\">Create a Database of Your Own<\/a><\/li>\n<li><a href=\"#connect\">Connecting to It From Your Code<\/a><\/li>\n<li><a href=\"#delete\">Deleting One<\/a><\/li>\n<li><a href=\"#faq\">Questions<\/a><\/li>\n<\/ol>\n<\/nav>\n<h2 id=\"look\">Look at What You Already Have<\/h2>\n<p>Open your hosting account in the client area and choose <strong>Databases<\/strong>. Everything on the account is listed: the database each WordPress site made for itself, and any you created yourself, with the size of each and which website it belongs to.<\/p>\n<figure class=\"hc-fig\"><img loading=\"lazy\" src=\"https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f.webp\" alt=\"The Databases screen in the HostCrafter panel: the phpMyAdmin sign-in, and every database on the account with its size and which website it belongs to\" width=\"1956\" height=\"1373\" class=\"wp-image-124\" decoding=\"async\" srcset=\"https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f.webp 1956w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f-300x210.webp 300w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f-1024x718.webp 1024w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f-768x539.webp 768w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/databases-section-34198de33f-1536x1077.webp 1536w\" sizes=\"auto, (max-width: 1956px) 100vw, 1956px\" \/><figcaption>The Databases screen. One phpMyAdmin login for the whole account, and every database with its size and owner.<\/figcaption><\/figure>\n<h2 id=\"phpmyadmin\">Open phpMyAdmin<\/h2>\n<p>Press <strong>Open phpMyAdmin<\/strong>. It opens in a new tab, already signed in. There is no password to find and none to type.<\/p>\n<p><strong>One login opens every database on the account.<\/strong> That is why there is a single button at the top rather than one per row: the sign-in is account-wide, and the row you were looking at only decides which database phpMyAdmin opens on first. Switch between them from phpMyAdmin&#8217;s own sidebar once you are in.<\/p>\n<div class=\"hc-cal\"> <b>Always open it from the panel.<\/b> The link is single-use and short-lived, so a bookmark of it will not work tomorrow. That is deliberate: it is what lets the button sign you in without a password existing for anyone to steal. <\/div>\n<h2 id=\"create\">Create a Database of Your Own<\/h2>\n<ol class=\"hc-steps\">\n<li>\n<h3>Press Create Database<\/h3>\n<p>It is in the <strong>Your own databases<\/strong> block, which also shows how many of your plan&#8217;s databases are in use.<\/p>\n<\/li>\n<li>\n<h3>Name the database and its user<\/h3>\n<p>Your account prefix is fixed in front of both fields, so the name you will actually get is on screen while you choose it. Leave the user field empty to give the user the same name as the database.<\/p>\n<figure class=\"hc-fig narrow\"><img loading=\"lazy\" src=\"https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/database-create-dialog-a22e74745c.webp\" alt=\"The Create a Database dialog, with the account prefix fixed in front of the name and user fields and a generated password\" width=\"992\" height=\"976\" class=\"wp-image-125\" decoding=\"async\" srcset=\"https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/database-create-dialog-a22e74745c.webp 992w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/database-create-dialog-a22e74745c-300x295.webp 300w, https:\/\/hostcrafter.com\/kb\/wp-content\/uploads\/2026\/09\/database-create-dialog-a22e74745c-768x756.webp 768w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><figcaption>The prefix is shown in front of the field you type into, so there is no guessing at the final name.<\/figcaption><\/figure>\n<\/li>\n<li>\n<h3>Take the generated password, or make another<\/h3>\n<p>At least ten characters. Quotes and backslashes are refused, because this password ends up inside configuration files and those two characters break them.<\/p>\n<\/li>\n<li>\n<h3>Copy the credentials before you close the dialog<\/h3>\n<p>The password is shown once and is not stored anywhere you can read it back. If you lose it, set a new one from the <strong>Password<\/strong> button on the database&#8217;s row.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"connect\">Connecting to It From Your Code<\/h2>\n<p>Four values, and only one of them is surprising:<\/p>\n<div class=\"hc-tw\"><table>\n<tr>\n<td><strong>Host<\/strong><\/td>\n<td><code>localhost<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Database<\/strong><\/td>\n<td>The prefixed name from the panel<\/td>\n<\/tr>\n<tr>\n<td><strong>Username<\/strong><\/td>\n<td>The prefixed user from the panel<\/td>\n<\/tr>\n<tr>\n<td><strong>Password<\/strong><\/td>\n<td>The one you copied when you created it<\/td>\n<\/tr>\n<\/table><\/div>\n<p>The host is <code>localhost<\/code> and not a hostname or an IP address. The database server is on the same machine as your site and does not accept connections from anywhere else, which is also why there is no &#8220;remote MySQL&#8221; setting to turn on. If you need to work on the data from your own computer, use phpMyAdmin, or export from it.<\/p>\n<h2 id=\"delete\">Deleting One<\/h2>\n<p>The <strong>Delete<\/strong> button on the row, and you are asked to type the name first. Deleting a database drops every table in it, permanently, and it is not covered by the Undo button anywhere in the panel.<\/p>\n<p>A database that WordPress is using cannot be deleted while WordPress is there; the button is disabled and says so. Remove the website first if that is really what you mean to do.<\/p>\n<div class=\"hc-cal warn\"> <b>A database is not covered by your website backups in the way you might expect.<\/b> Each website&#8217;s backup includes its own database. A database you created yourself for a script of your own is not attached to any website, so take your own copy from phpMyAdmin&#8217;s <strong>Export<\/strong> tab before you change anything structural. <\/div>\n<h2 id=\"faq\">Questions<\/h2>\n<div class=\"hc-faq\">\n<h3>Do I need to create a database before installing WordPress?<\/h3>\n<p>No. Adding a website creates the database, the user and the password, and writes them into <code>wp-config.php<\/code> for you.<\/p>\n<h3>What is my WordPress database password?<\/h3>\n<p>It is in <code>wp-config.php<\/code> in that site&#8217;s folder, which you can open in the <a href=\"\/kb\/file-manager-and-sftp\/\">file manager<\/a>. You will rarely need it: phpMyAdmin signs you in without it.<\/p>\n<h3>Why is there a prefix on every name?<\/h3>\n<p>Because database names are shared across the whole server. The prefix is what makes <code>shop<\/code> yours rather than a name somebody else has already taken.<\/p>\n<h3>Can I connect from MySQL Workbench or Sequel Ace?<\/h3>\n<p>Your database is reachable from your own site and nothing else, which is what keeps it off the public internet entirely. phpMyAdmin gives you the same browsing, querying, import and export those tools do, from anywhere, with no client to configure.<\/p>\n<h3>How do I import a .sql file?<\/h3>\n<p>phpMyAdmin&#8217;s <strong>Import<\/strong> tab. If the file is large enough to time out, open a ticket and send it to us instead. We can import it directly on the server.<\/p>\n<h3>How many databases can I have?<\/h3>\n<p>It depends on your plan, and the panel prints the figure above the list as &#8220;N of M used&#8221;.<\/p>\n<\/div>\n<div class=\"hc-rel\">\n<h2>Read next<\/h2>\n<ul>\n<li><a href=\"\/kb\/file-manager-and-sftp\/\">File Manager and SFTP: Two Ways Into Your Files<\/a><\/li>\n<li><a href=\"\/kb\/change-php-version\/\">How to Change Your PHP Version<\/a><\/li>\n<li><a href=\"\/kb\/automatic-wordpress-backups\/\">Automatic Backups: What Is Taken, and When<\/a><\/li>\n<\/ul><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Create a MySQL database and user from the panel, and open phpMyAdmin with one click. WordPress gets its own database automatically.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-databases"],"_links":{"self":[{"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":2,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/posts\/142\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostcrafter.com\/kb\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}