{"id":18774,"date":"2021-09-18T14:36:59","date_gmt":"2021-09-18T14:36:59","guid":{"rendered":"https:\/\/supporthost.com\/?post_type=tutorial&#038;p=18774"},"modified":"2024-06-04T10:10:50","modified_gmt":"2024-06-04T10:10:50","slug":"create-database","status":"publish","type":"tutorial","link":"https:\/\/supporthost.com\/tutorial\/create-database\/","title":{"rendered":"How to create a MySQL database with cPanel"},"content":{"rendered":"\n<p>cPanel allows us to create a database with two different tools that we find in the <em>Database <\/em>section: <strong>MySQL database<\/strong> and the <strong>wizard<\/strong>. In this guide, we will see how to create a database from cPanel. But first, let&#8217;s see what databases are used for.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-a-database\">What is a database<\/a><\/li><li><a href=\"#how-to-create-a-database\">How to create a database<\/a><ul><li><a href=\"#create-a-new-user\">Create a new user<\/a><\/li><li><a href=\"#add-the-user-to-the-database\">Add the user to the database<\/a><\/li><\/ul><\/li><li><a href=\"#how-to-create-a-database-with-the-database-wizard\">How to create a database with the Database wizard<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel-1024x538.png\" alt=\"How To Create A Mysql Database With Cpanel\" class=\"wp-image-18775\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel-1024x538.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel-300x158.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel-768x403.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel-120x63.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/how-to-create-a-mysql-database-with-cpanel.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-database\">What is a database<\/h2>\n\n\n\n<p>A database is a set of data organized in tables, and <strong>MySQL <\/strong>is one of the most used database management systems.<\/p>\n\n\n\n<p>Databases can be used for a PHP application or the operation of the main CMS, such as <a href=\"https:\/\/supporthost.com\/what-is-wordpress\/\" data-type=\"post\" data-id=\"18157\">WordPress<\/a>, Joomla, or PrestaShop.<\/p>\n\n\n\n<p>For example, if you have to <a href=\"https:\/\/supporthost.com\/install-wordpress\/\" target=\"_blank\" data-type=\"post\" data-id=\"18159\" rel=\"noreferrer noopener\">install WordPress<\/a> or PrestaShop manually, you will need to create a new database. Instead, in the case of a <a href=\"https:\/\/supporthost.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress hosting<\/a> or <a href=\"https:\/\/supporthost.com\/prestashop-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">PrestaShop hosting<\/a>, the MySQL database needed by the CMS will be configured automatically when we provision your account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-create-a-database\">How to create a database<\/h2>\n\n\n\n<p>The first thing to do is to <a href=\"https:\/\/supporthost.com\/tutorial\/cpanel-login\/\" data-type=\"tutorial\" data-id=\"16503\" target=\"_blank\" rel=\"noreferrer noopener\">login to cPanel<\/a>. After logging in, you will see the main page of the control panel of your hosting account, and you will have to scroll to the Database section and click on <strong>MySQL Database<\/strong> as you see on this screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"131\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel-1024x131.png\" alt=\"Mysql Databases Cpanel\" class=\"wp-image-18776\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel-1024x131.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel-300x38.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel-768x98.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel-120x15.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-databases-cpanel.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To create a database, just enter the database name in the first section, &#8220;Create a new database&#8221;, and click on the &#8220;Create database&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"443\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database-1024x443.png\" alt=\"Create New Database\" class=\"wp-image-18777\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database-1024x443.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database-300x130.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database-768x333.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database-120x52.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-new-database.png 1060w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>A warning like this will tell you that the database creation was successful.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"636\" height=\"205\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-added.png\" alt=\"Database Added\" class=\"wp-image-18778\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-added.png 636w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-added-300x97.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-added-120x39.png 120w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/figure>\n\n\n\n<p class=\"note\">Note that cPanel will automatically insert a prefix preceding the database name. This prefix is \u200b\u200byour cPanel username.<\/p>\n\n\n\n<p>The full database name will then look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Username_database<\/pre>\n\n\n\n<p>If your username is <em>Mysite<\/em> and your database name is <em>database1<\/em> the full name will be<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>Mysite_database1<\/em><\/pre>\n\n\n\n<p>Note that to connect to the database, you will need to use the<strong> full name<\/strong>.<\/p>\n\n\n\n<p>To use the database you have created, you will need to create and then add a user to the database. Let&#8217;s see how to create a new user and associate it with the newly created database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-new-user\">Create a new user<\/h3>\n\n\n\n<p>From the cPanel main page, click on<em> MySQL database<\/em>. This time we scroll down the page to <strong>MySQL Users &#8211; Add New User<\/strong> section.<\/p>\n\n\n\n<p>So we now have to choose the username and password and write them twice in the two fields you see. To complete the operation, click on the <em>Create user<\/em> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user-1024x500.png\" alt=\"Create Database Add New User\" class=\"wp-image-18780\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user-1024x500.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user-300x146.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user-768x375.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user-120x59.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-add-new-user.png 1195w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-the-user-to-the-database\">Add the user to the database<\/h3>\n\n\n\n<p>We have just created our new user, now we have another step to take, which is to associate this user with our database, giving it the right privileges.<\/p>\n\n\n\n<p>If you are not already on this screen, open <em>MySQL Databases<\/em> from the <em>Database <\/em>section of cPanel.<\/p>\n\n\n\n<p>Scroll down to the <em>Add User to Database<\/em> section. The first drop-down menu allows us to select the user in our case <em>user1<\/em>, the second menu allows us to choose which database to associate the user with (<em>db1<\/em> in our example). After selecting them, click on the <strong>Add <\/strong>button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"308\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/add-user-to-database.png\" alt=\"Add User To Database\" class=\"wp-image-18781\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/add-user-to-database.png 940w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/add-user-to-database-300x98.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/add-user-to-database-768x252.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/add-user-to-database-120x39.png 120w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p>A new window will open in which you will need to select the user&#8217;s <strong>privileges<\/strong>, click on the box next to <em>All privileges<\/em> and then click on the <em>Make changes<\/em> button at the bottom.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"833\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-manage-user-privileges.png\" alt=\"Database Manage User Privileges\" class=\"wp-image-18782\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-manage-user-privileges.png 978w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-manage-user-privileges-300x256.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-manage-user-privileges-768x654.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/database-manage-user-privileges-74x63.png 74w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-create-a-database-with-the-database-wizard\">How to create a database with the Database wizard<\/h2>\n\n\n\n<p>An even easier way to create a database is to use cPanel MySQL Database Wizard tool. This tool basically does all the steps we did before, but in a more automated and faster way.<\/p>\n\n\n\n<p>Log in to cPanel and scroll down to the <em>Databases <\/em>section, then click on MySQL Database Wizard, as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"102\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard-1024x102.png\" alt=\"Mysql Database Wizard\" class=\"wp-image-18783\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard-1024x102.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard-300x30.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard-768x76.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard-120x12.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/mysql-database-wizard.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 1<\/strong>: enter the database name. Note that the full database name will consist of a prefix (indicated in the gray box) and the name you choose. Fill in the field and click on <em>Next step<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"404\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-1.png\" alt=\"Create Database Wizard Step 1\" class=\"wp-image-18784\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-1.png 764w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-1-300x159.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-1-120x63.png 120w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n\n\n\n<p><strong>Step 2<\/strong>: now, you will need to create a new user to associate with your database. The first field to fill in is that of the username, note that also in this case, as for the database name, the user name will be provided by a prefix and the name you choose.<\/p>\n\n\n\n<p>Choose the user&#8217;s password and enter it a second time in the Password field (again). You can also use the password generator to create one, be sure to copy it to a safe place before proceeding. After filling in all the fields, click on <em>Create user<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1007\" height=\"566\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-2.png\" alt=\"Create Database Wizard Step 2\" class=\"wp-image-18785\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-2.png 1007w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-2-300x169.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-2-768x432.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-2-112x63.png 112w\" sizes=\"auto, (max-width: 1007px) 100vw, 1007px\" \/><\/figure>\n\n\n\n<p><strong>Step 3<\/strong>: at this point, we can assign privileges to the newly created user. Check the box for <em>All Privileges<\/em>, as you see in the screenshot below, and then click on <strong>Next step<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"651\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3-1024x651.png\" alt=\"Create Database Wizard Step 3\" class=\"wp-image-18786\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3-1024x651.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3-300x191.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3-768x488.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3-99x63.png 99w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-3.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 4<\/strong>: we created the database, a new user, and associated the user with the database. At this point, we can complete the procedure by returning to the cPanel home page, create another database, create another user or return to the MySQL databases screen.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"324\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-4.png\" alt=\"Create Database Wizard Step 4\" class=\"wp-image-18787\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-4.png 525w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-4-300x185.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/09\/create-database-wizard-step-4-102x63.png 102w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n","protected":false},"author":1,"featured_media":43847,"template":"","tutorial-cat":[14],"class_list":["post-18774","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","tutorial-cat-database"],"acf":[],"_links":{"self":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial\/18774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial\/18774\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/media\/43847"}],"wp:attachment":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/media?parent=18774"}],"wp:term":[{"taxonomy":"tutorial-cat","embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial-cat?post=18774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}