{"id":8345,"date":"2022-05-11T12:47:17","date_gmt":"2022-05-11T12:47:17","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=8345"},"modified":"2026-02-26T14:02:49","modified_gmt":"2026-02-26T14:02:49","slug":"create-a-mysql-database-and-a-username","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/","title":{"rendered":"Create a MySQL Database and a Username."},"content":{"rendered":"<p><strong><\/strong><\/p>\r\n<p>We&#8217;ll show you how to make a CNCC user and a CNCC database in this article.<\/p>\r\n\r\n\r\n\r\n<ol>\r\n<li>Log in to the server or machine that has access to the NDB cluster&#8217;s SQL nodes.<\/li>\r\n<li>Now, one by one, connect to the SQL nodes of the NDB cluster.<\/li>\r\n<li>Run the following command and To login to the MySQL prompt using root permission or a user who has access to create users with permissions.<br \/>Note: After running the program, the user must input the MySql password.<br \/>mysql -h -uroot -p<\/li>\r\n<li>Create a CNCC user if one does not already exist by running the following commands and Verify whether a CNCC user already exists.\r\n<ol>\r\n<li>Execute $ SELECT User FROM mysql.user; to list the users<\/li>\r\n<li>Create a new user if one does not already exist <br \/><br \/><code>$ CREATE USER '&lt;CNCC User Name&gt;'@'%' IDENTIFIED BY '&lt;CNCC Password&gt;';<\/code><br \/><br \/><\/li>\r\n<\/ol>\r\n<\/li>\r\n<li>Create a CNCC database if one does not already exist, and provide rights to the CNCC user established in the preceding step. Examine the CNCC database to see whether it already exists.<br \/>Execute <code>$ show databases;\u00a0<\/code>to check if the database exists<br \/>\r\n<ol>\r\n<li>Drop the CNCC database created in MySql as of version 1.0.0 before generating cnccdb using the following command:<br \/>DROP DATABASE cnccdb<\/li>\r\n<li>Execute <code>$ CREATE DATABASE IF NOT EXISTS &lt;CNCC Database&gt; CHARACTER SET utf8;<\/code>\u00a0for Database creation.<\/li>\r\n<li>Execute the following command to grant permission to the user.<br \/><code>$ GRANT SELECT,INSERT,CREATE,ALTER,DROP,LOCK TABLES,CREATE TEMPORARY TABLES, DELETE,UPDATE,EXECUTE ON &lt;CNCC Database&gt;.* TO '&lt;CNCC User Name&gt;'@'%';<\/code><\/li>\r\n<\/ol>\r\n<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<p>To show how to create a cncc user, a cnccdb, and provide rights to a cncc user, consider the following scenario:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code># Login to MySql prompt:-\r\n$ mysql -u root -p\r\nCheck user already exists or not\r\n$ SELECT User FROM mysql.user;\r\n# In case, user already exists, move to next step. Command to create new user is as mentioned below:-\r\n$ CREATE USER 'cnccusr'@'%' IDENTIFIED BY 'cnccpasswd'\r\n# Command to check if database exists:-\r\n$ show databases;\r\n# Check if required database is already in list. If MySql has cnccdb already created as per 1.0.0 release creation, drop it.  \r\n$ DROP DATABASE cnccdb;\r\n# Database creation for CNCC\r\n$ CREATE DATABASE IF NOT EXISTS cnccdb CHARACTERSET utf8;\r\n#Granting permission to user:-\r\n$ GRANT SELECT, INSERT, CREATE, ALTER, DROP, LOCK TABLES, CREATE TEMPORARY TABLES, DELETE, UPDATE, EXECUTE ON cnccdb .* TO'cnccusr'@'%';<\/code><\/pre>\r\n\r\n\r\n\r\n<p>We genuinely hope you now have a better understanding of Create a MySQL database and a username. If you continue to have problems with the method outlined above, please contact the <a href=\"https:\/\/www.bodhost.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">bodHOST <\/a>Team for assistance. 24\u00d77<\/p>\r\n<p><strong><\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>We&#8217;ll show you how to make a CNCC user and a CNCC database in this article. Log in to the server or machine that has access to the NDB cluster&#8217;s&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[1079,1080],"class_list":["post-8345","post","type-post","status-publish","format-standard","hentry","category-sql","tag-create-a-mysql-database","tag-username"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a MySQL Database and a Username<\/title>\n<meta name=\"description\" content=\"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.\" \/>\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.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/\" \/>\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 and a Username\" \/>\n<meta property=\"og:description\" content=\"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-11T12:47:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:49+00:00\" \/>\n<meta name=\"author\" content=\"Vincer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vincer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/\"},\"author\":{\"name\":\"Vincer\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\"},\"headline\":\"Create a MySQL Database and a Username.\",\"datePublished\":\"2022-05-11T12:47:17+00:00\",\"dateModified\":\"2026-02-26T14:02:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/\"},\"wordCount\":267,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"Create a MySQL Database\",\"Username\"],\"articleSection\":[\"SQL\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/\",\"name\":\"How to Create a MySQL Database and a Username\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2022-05-11T12:47:17+00:00\",\"dateModified\":\"2026-02-26T14:02:49+00:00\",\"description\":\"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/create-a-mysql-database-and-a-username\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SQL\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/sql\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a MySQL Database and a Username.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\",\"name\":\"Vincer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"caption\":\"Vincer\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/vinayak\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a MySQL Database and a Username","description":"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.","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.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a MySQL Database and a Username","og_description":"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.","og_url":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2022-05-11T12:47:17+00:00","article_modified_time":"2026-02-26T14:02:49+00:00","author":"Vincer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vincer","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/"},"author":{"name":"Vincer","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0"},"headline":"Create a MySQL Database and a Username.","datePublished":"2022-05-11T12:47:17+00:00","dateModified":"2026-02-26T14:02:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/"},"wordCount":267,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["Create a MySQL Database","Username"],"articleSection":["SQL"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/","url":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/","name":"How to Create a MySQL Database and a Username","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2022-05-11T12:47:17+00:00","dateModified":"2026-02-26T14:02:49+00:00","description":"In this article, we have explained how to create a MySQL database and a username. For more information, you can visit our website.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/create-a-mysql-database-and-a-username\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SQL","item":"https:\/\/www.bodhost.com\/kb\/category\/sql\/"},{"@type":"ListItem","position":2,"name":"Create a MySQL Database and a Username."}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0","name":"Vincer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","caption":"Vincer"},"url":"https:\/\/www.bodhost.com\/kb\/author\/vinayak\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=8345"}],"version-history":[{"count":7,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8345\/revisions"}],"predecessor-version":[{"id":11805,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/8345\/revisions\/11805"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=8345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=8345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=8345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}