{"id":4694,"date":"2018-10-01T21:15:12","date_gmt":"2018-10-02T01:15:12","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2018\/10\/01\/how-to-create-a-database-using-mysql-from-the-command-line\/"},"modified":"2026-12-02T15:45:30","modified_gmt":"2026-12-02T20:45:30","slug":"create-a-mysql-database","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/","title":{"rendered":"How to Create a MySQL Database Using CLI &#038; cPanel"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png\" alt=\"Learn How to Create a MySQL Database Using CLI &amp; cPanel\" class=\"wp-image-103229\" title=\"Create a MySQL Database in the Terminal\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you need to create a database for your website there are multiple ways to do it. In this guide, you can learn how to <strong>create a MySQL database<\/strong> using two methods: the command line interface (CLI) and cPanel MySQL Database Wizard. You can then being using the database or connect your software. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cli\">Create a MySQL Database Using CLI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running a Linux server with MySQL but no cPanel, you can simply use the terminal to create a MySQL database, database user, and password, as well as, assign all privileges to the user for the database.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"jetpack-video-wrapper\"><div class=\"yt-ZrS3IT7HG2Y\">\n\t<a class=\"play-video-ZrS3IT7HG2Y\" style=\"position: relative; display: flex; flex-wrap: wrap; align-items: center; cursor: pointer;\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.ytimg.com\/vi_webp\/ZrS3IT7HG2Y\/maxresdefault.webp\" width=\"1280\" height=\"720\" alt=\"How to Create a MySQL Database Using the Command Line\" style=\"width: 100%; height: auto;\">\n\t\t<span class=\"fa fa-imh-play-circle imh-ds-icon play-circle\" style=\"position: absolute; display:block; font-size:150px; color: #c52228; opacity:0;\"><\/span>\n\t<\/a>\n<\/div><\/div>\n<\/div><figcaption class=\"wp-element-caption\">Don\u2019t have time to read the article? Watch our walk-through video.<\/figcaption><\/figure>\n\n\n\n<p class=\"alert alert-info wp-block-paragraph\"><strong>IMPORTANT:<\/strong> This guide is intended for use with our Self-Managed VPS Hosting and other hosting plans that do not include cPanel. If your server includes cPanel, you should follow our guide on <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-create-a-mysql-database-using-the-cpanel-api\/\">How to Create a MySQL Database Using the cPanel API<\/a>.<\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-login-ssh\/\">SSH into your server<\/a> as root.<\/li>\n\n\n\n<li>Log into MySQL as root:<pre>mysql -u root<\/pre><\/li>\n\n\n\n<li>Create a new database user: <pre>GRANT ALL PRIVILEGES ON *.* TO 'db_user'@'localhost' IDENTIFIED BY 'P@s$w0rd123!';<\/pre> <div class=\"alert alert-info\" role=\"alert\"><b>NOTE:<\/b> Be sure to modify <code>db_user<\/code> with the actual name, you would like to give the database user, as well as, <code>P@s$w0rd123!<\/code> with the password to be given to the user.<\/div> <\/li>\n\n\n\n<li>Log out of MySQL by typing: <code>\\q<\/code>.<\/li>\n\n\n\n<li>Log in as the new database user you just created: <pre>mysql -u db_user -p<\/pre> <div class=\"alert alert-info\" role=\"alert\"><b>NOTE:<\/b> Be sure to modify <code>db_user<\/code> with the actual database user name.<\/div> <\/li>\n\n\n\n<li>Then, type the new database user\u2019s password and press <strong>Enter<\/strong>.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"358\" class=\"wp-image-78819\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/create-a-database-cli.png\" alt=\"Create a Database in the Command Line Interface (CLI)\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/create-a-database-cli.png 1224w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/create-a-database-cli-300x143.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/create-a-database-cli-1024x489.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/create-a-database-cli-768x366.png 768w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/li>\n\n\n\n<li>Create a new database by running the following command and specifying the name of the database: <pre>CREATE DATABASE db_name;<\/pre> <div class=\"alert alert-info\" role=\"alert\"><b>NOTE:<\/b> Be sure to modify <code>db_name<\/code> with the actual name you would like to give the database.<\/div><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cpanel-database\">How to Create a MySQL Database in cPanel<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"jetpack-video-wrapper\"><div class=\"yt-M2CNS74_3f4\">\n\t<a class=\"play-video-M2CNS74_3f4\" style=\"position: relative; display: flex; flex-wrap: wrap; align-items: center; cursor: pointer;\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.ytimg.com\/vi_webp\/M2CNS74_3f4\/maxresdefault.webp\" width=\"1280\" height=\"720\" alt=\"How to Create A MySQL Database in cPanel\" style=\"width: 100%; height: auto;\">\n\t\t<span class=\"fa fa-imh-play-circle imh-ds-icon play-circle\" style=\"position: absolute; display:block; font-size:150px; color: #c52228; opacity:0;\"><\/span>\n\t<\/a>\n<\/div><\/div>\n<\/div><figcaption class=\"wp-element-caption\">Don\u2019t have time to read the full guide? Watch our walk-through video.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you create a database, many users are unaware that there are several other tasks that you need to do as well. The new database creation process actually involves:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Creating a database<\/li>\n\n\n\n<li>Creating a database user<\/li>\n\n\n\n<li>Giving your database user access to work with your database<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Luckily for us, cPanel includes a <strong>MySQL Database Wizard<\/strong> that walks you through each of these steps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a Database in cPanel Using the MySQL Database Wizard<\/h3>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into your cPanel<\/a>.<\/li>\n\n\n\n<li>Click the <strong>MySQL Database Wizard<\/strong> under the <em>Databases<\/em> heading.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"216\" class=\"wp-image-103220\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1766.png\" alt=\"Accessing the MySQL Database Wizard\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1766.png 986w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1766-300x86.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1766-768x221.png 768w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/li>\n\n\n\n<li>Next to <strong>New Database<\/strong> enter a name for your database and click <strong>Next Step<\/strong>.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"211\" class=\"wp-image-103221\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1768.png\" alt=\"Entering a Database Name\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1768.png 676w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1768-300x84.png 300w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><br><div class=\"alert alert-warning\" role=\"alert\"><strong>WARNING:<\/strong> If you receive an error message regarding the limited number of databases available, you may consider upgrading your <a href=\"\/shared-hosting\">shared server space<\/a>.<\/div><\/li>\n\n\n\n<li>Enter a <strong>username<\/strong>, enter a password twice, then click the <strong>Create User<\/strong> button.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"295\" class=\"wp-image-103222\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1769.png\" alt=\"Creating a Database User\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1769.png 1039w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1769-300x118.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1769-1024x403.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1769-768x302.png 768w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/li>\n\n\n\n<li>On the next page, you\u2019ll assign privileges for the user to the database. Check the box next to <strong>All Privileges<\/strong> and then click <strong>Next Step<\/strong>. You can also select specific privileges instead.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"375\" class=\"wp-image-103223\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770.png\" alt=\"Providing Privileges to the Database User\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770.png 1602w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770-300x150.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770-1024x513.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770-768x384.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1770-1536x769.png 1536w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><br><br>You are finished when you see a message stating that the user was added to the database.<br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"179\" class=\"wp-image-103224\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1771.png\" alt=\"User Was Added to the Database\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1771.png 904w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1771-300x72.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/03\/Selection_1771-768x184.png 768w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Congratulations!<\/strong> Now, you know how to create a MySQL database from the command line and using cPanel. Want to learn more about database management? Check out <a href=\"https:\/\/dev.mysql.com\/doc\/\" target=\"_blank\" rel=\"noreferrer noopener\">official MySQL documentation<\/a> or our guide on <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-import-mysql-databases-in-command-line\/\">How to Import MySQL Databases in Command Line<\/a>.<\/p>\n\n\n<div class=\"jumbotron\" style=\"text-align:center;\">\r\n<p style=\"font-size: 20px;\"><strong>Scalable VPS Infrastructure, Fully Managed<\/strong><\/p>\r\n<p>When shared hosting can't handle your traffic, VPS delivers dedicated resources that scale with demand. Our team manages the technical complexity while you manage your business.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>NVMe Storage &nbsp;&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>High-Availability &nbsp;&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Ironclad Security &nbsp;&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Premium Support<\/p>\r\n<p><a class=\"btn btn-primary btn-lg\" href=\"https:\/\/www.inmotionhosting.com\/vps-hosting?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=vps-cta2\">VPS Hosting<\/a><\/p>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you need to create a database for your website there are multiple ways to do it. In this guide, you can learn how to create a MySQL database using two methods: the command line interface (CLI) and cPanel MySQL Database Wizard. You can then being using the database or connect your software. Create a<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_ayudawp_aiss_exclude":false,"_ayudawp_aiss_exclude_summary":false,"_ayudawp_aiss_summary":"In this guide, you can learn how to create a MySQL database using two methods: the command line interface (CLI) and cPanel MySQL Database Wizard. If you are running a Linux server with MySQL but no cPanel, you can simply use the terminal to create a MySQL database, database user, and password, as well as, assign all privileges to the user for the database. Creating a Database in cPanel Using the MySQL Database Wizard.","_ayudawp_aiss_summary_provider":"extractive","_ayudawp_aiss_summary_hash":"aee785da9e10dec3a20b53d7bbaa55ed83e023dd","_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4305],"tags":[],"class_list":["post-4694","post","type-post","status-publish","format-standard","hentry","category-databases"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a MySQL Database in CLI and cPanel<\/title>\n<meta name=\"description\" content=\"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.\" \/>\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\/server\/databases\/create-a-mysql-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a MySQL Database in CLI and cPanel\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/\" \/>\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=\"2018-10-02T01:15:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-12-02T20:45:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/#\\\/schema\\\/person\\\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"How to Create a MySQL Database Using CLI &#038; cPanel\",\"datePublished\":\"2018-10-02T01:15:12+00:00\",\"dateModified\":\"2026-12-02T20:45:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/\"},\"wordCount\":540,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png\",\"articleSection\":[\"Working with Databases\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/\",\"url\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/\",\"name\":\"How to Create a MySQL Database in CLI and cPanel\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png\",\"datePublished\":\"2018-10-02T01:15:12+00:00\",\"dateModified\":\"2026-12-02T20:45:30+00:00\",\"description\":\"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Technology-How-To-Solid-3-Jacksons-Purple-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Technology-How-To-Solid-3-Jacksons-Purple-1.png\",\"width\":1200,\"height\":630,\"caption\":\"Learn How to Create a MySQL Database Using CLI & cPanel\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/server\\\/databases\\\/create-a-mysql-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a MySQL Database Using CLI &#038; cPanel\"}]},{\"@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\\\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inmotion-hosting\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/InMotionHosting\"],\"url\":\"https:\\\/\\\/www.inmotionhosting.com\\\/support\\\/author\\\/inmotion-hosting-contributor\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a MySQL Database in CLI and cPanel","description":"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.","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\/server\/databases\/create-a-mysql-database\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a MySQL Database in CLI and cPanel","og_description":"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2018-10-02T01:15:12+00:00","article_modified_time":"2026-12-02T20:45:30+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png","type":"image\/png"}],"author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"How to Create a MySQL Database Using CLI &#038; cPanel","datePublished":"2018-10-02T01:15:12+00:00","dateModified":"2026-12-02T20:45:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/"},"wordCount":540,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png","articleSection":["Working with Databases"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/","name":"How to Create a MySQL Database in CLI and cPanel","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1-1024x538.png","datePublished":"2018-10-02T01:15:12+00:00","dateModified":"2026-12-02T20:45:30+00:00","description":"Learn how to create a MySQL database using the command line and using cPanel. You can then connect your software to this database.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2018\/10\/Technology-How-To-Solid-3-Jacksons-Purple-1.png","width":1200,"height":630,"caption":"Learn How to Create a MySQL Database Using CLI & cPanel"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/create-a-mysql-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Create a MySQL Database Using CLI &#038; cPanel"}]},{"@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\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","primary_category":{"id":4305,"name":"Working with Databases","slug":"databases","link":"https:\/\/www.inmotionhosting.com\/support\/server\/databases\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4694","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\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=4694"}],"version-history":[{"count":20,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4694\/revisions"}],"predecessor-version":[{"id":900997,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4694\/revisions\/900997"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=4694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=4694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=4694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}