{"id":33,"date":"2018-10-30T09:22:13","date_gmt":"2018-10-30T09:22:13","guid":{"rendered":"https:\/\/www.onlinenote.in\/sql\/?p=33"},"modified":"2019-07-25T13:11:51","modified_gmt":"2019-07-25T07:41:51","slug":"mysql-login-database-user-creation","status":"publish","type":"post","link":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/","title":{"rendered":"MySql Login, Database &#038; User Creation"},"content":{"rendered":"<p><strong>Step 1:<\/strong>\u00a0Login to MySQL ( you will need an account )<\/p>\n<pre class=\"lang:default decode:true\">mysql -u [user] -p<\/pre>\n<p>Enter password:- Enter your mysql password<\/p>\n<p><strong>Step 2:<\/strong>\u00a0Create the Database<\/p>\n<pre class=\"lang:default decode:true\">mysql&gt; create database [database_name];<\/pre>\n<p><strong>Step 3:<\/strong>\u00a0Verify that it&#8217;s there<\/p>\n<pre class=\"lang:default decode:true\">mysql&gt; show databases;<\/pre>\n<p><strong>Step 4:<\/strong>\u00a0Create the User<\/p>\n<pre class=\"lang:default decode:true\">mysql&gt; CREATE USER [new_user]@[hostname] IDENTIFIED BY [password];<\/pre>\n<p>Example:- <code>CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'password123';<\/code><\/p>\n<p><strong>Step 5:<\/strong>\u00a0Grant privileges while assigning the password<\/p>\n<pre class=\"lang:default decode:true\">mysql&gt; GRANT ALL PRIVILEGES ON [database] . * TO [new_user]@[hostname];<\/pre>\n<p>Example:- <code>GRANT ALL PRIVILEGES ON databasename . * TO 'dbuser'@'localhost';<\/code><\/p>\n<p>*Note: The\u00a0<em>localhost<\/em>\u00a0field usually doesn&#8217;t have to be edited, but you can set it to the specific address.<\/p>\n<p>The above example grants\u00a0<em>all<\/em>\u00a0privileges, obviously. But you will likely want to limit privileges under many circumstances. These parameters include\u00a0<em>select<\/em>,\u00a0<em>insert<\/em>, and\u00a0<em>delete<\/em>.<br \/>\nChoose all that apply and separate by comma:<\/p>\n<pre class=\"lang:default decode:true \">grant select, insert, delete, update on db_name.* to 'db_user'@'localhost' identified by 'db_password';<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1:\u00a0Login to MySQL ( you will need an account ) mysql -u [user] -p Enter password:- Enter your mysql password Step 2:\u00a0Create the Database mysql&gt; create database [database_name]; Step 3:\u00a0Verify that it&#8217;s there mysql&gt; show databases; Step 4:\u00a0Create the User mysql&gt; CREATE USER [new_user]@[hostname] IDENTIFIED BY [password]; Example:- CREATE USER &#8216;dbuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;password123&#8217;; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySql Login, Database &amp; User Creation - SQL<\/title>\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.onlinenote.in\/sql\/mysql-login-database-user-creation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySql Login, Database &amp; User Creation - SQL\" \/>\n<meta property=\"og:description\" content=\"Step 1:\u00a0Login to MySQL ( you will need an account ) mysql -u [user] -p Enter password:- Enter your mysql password Step 2:\u00a0Create the Database mysql&gt; create database [database_name]; Step 3:\u00a0Verify that it&#8217;s there mysql&gt; show databases; Step 4:\u00a0Create the User mysql&gt; CREATE USER [new_user]@[hostname] IDENTIFIED BY [password]; Example:- CREATE USER &#039;dbuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;password123&#039;; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-30T09:22:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-25T07:41:51+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/\",\"url\":\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/\",\"name\":\"MySql Login, Database & User Creation - SQL\",\"isPartOf\":{\"@id\":\"https:\/\/www.onlinenote.in\/sql\/#website\"},\"datePublished\":\"2018-10-30T09:22:13+00:00\",\"dateModified\":\"2019-07-25T07:41:51+00:00\",\"author\":{\"@id\":\"\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.onlinenote.in\/sql\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySql Login, Database &#038; User Creation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.onlinenote.in\/sql\/#website\",\"url\":\"https:\/\/www.onlinenote.in\/sql\/\",\"name\":\"SQL\",\"description\":\"Code Snippets\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.onlinenote.in\/sql\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySql Login, Database & User Creation - SQL","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.onlinenote.in\/sql\/mysql-login-database-user-creation\/","og_locale":"en_US","og_type":"article","og_title":"MySql Login, Database & User Creation - SQL","og_description":"Step 1:\u00a0Login to MySQL ( you will need an account ) mysql -u [user] -p Enter password:- Enter your mysql password Step 2:\u00a0Create the Database mysql&gt; create database [database_name]; Step 3:\u00a0Verify that it&#8217;s there mysql&gt; show databases; Step 4:\u00a0Create the User mysql&gt; CREATE USER [new_user]@[hostname] IDENTIFIED BY [password]; Example:- CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'password123'; [&hellip;]","og_url":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/","og_site_name":"SQL","article_published_time":"2018-10-30T09:22:13+00:00","article_modified_time":"2019-07-25T07:41:51+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/","url":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/","name":"MySql Login, Database & User Creation - SQL","isPartOf":{"@id":"https:\/\/www.onlinenote.in\/sql\/#website"},"datePublished":"2018-10-30T09:22:13+00:00","dateModified":"2019-07-25T07:41:51+00:00","author":{"@id":""},"breadcrumb":{"@id":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.onlinenote.in\/sql\/mysql-login-database-user-creation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.onlinenote.in\/sql\/"},{"@type":"ListItem","position":2,"name":"MySql Login, Database &#038; User Creation"}]},{"@type":"WebSite","@id":"https:\/\/www.onlinenote.in\/sql\/#website","url":"https:\/\/www.onlinenote.in\/sql\/","name":"SQL","description":"Code Snippets","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.onlinenote.in\/sql\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":""}]}},"_links":{"self":[{"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":2,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/posts\/33\/revisions\/85"}],"wp:attachment":[{"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onlinenote.in\/sql\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}