{"id":69,"date":"2014-07-05T15:49:25","date_gmt":"2014-07-05T13:49:25","guid":{"rendered":"http:\/\/servikus.com\/tutorials\/?p=69"},"modified":"2014-07-07T10:23:53","modified_gmt":"2014-07-07T08:23:53","slug":"how-to-create-database-and-user-for-mysql-and-give-user-permissions-in-cpanell","status":"publish","type":"post","link":"https:\/\/servikus.com\/tutorials\/how-to-create-database-and-user-for-mysql-and-give-user-permissions-in-cpanell\/","title":{"rendered":"How to create database and user for MySQL and give user permissions in cPanel"},"content":{"rendered":"<p>Now days almost all websites use MySQL to store information and most of the scripts have auto install options. Anyway, auto install option can&#8217;t create database and user for your database and that is something that you need to do yourself. In this simple tutorial we will show you how to create database and user, and then give user proper permissions to database.<\/p>\n<p>First of all you should start by logging in to your cPanel hosting account.<\/p>\n<ul>\n<li>\n<div>Go and click on MySQL Databases icon as shown on the image below:<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate1.png\" alt=\"\" \/><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>\n<div>New page will open, on the new page find the box that says &#8220;Create New Database&#8221; and add name to your database, for this example name of database is &#8220;mydb1&#8221;. Click on Create Database button.<\/div>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate2.png\" alt=\"\" \/><\/li>\n<li>\n<div>New page will open with result of your database creation as shown on the image below. Please note that your full database name is actually <strong>userdoma_mydb1 <\/strong>and not mydb1 as you named it, because of the prefix that each cPanel database and username have.<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate3.png\" alt=\"\" \/><\/li>\n<\/ul>\n<p>You have now successfully created database. Now you need to create user and then give user proper permissions. Click on the Go Back button.<\/p>\n<ul style=\"margin-left: 54pt;\">\n<li>\n<div>Find section that says MySQL Users -&gt; Add New User as shown on the picture below<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate4.png\" alt=\"\" \/><\/li>\n<li>Fill in username field (in our case we have named user: user1), for password use password generator or enter your own password. We have used password generator. Click Create User button.<\/li>\n<li>\n<div>New page will appear with username and password in our case sample is shown on the image below. Click Go Back button.<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate5.png\" alt=\"\" \/><\/li>\n<\/ul>\n<p>Now after creating database and user, you do need to give user permissions to access that database.<\/p>\n<ul style=\"margin-left: 54pt;\">\n<li>\n<div>Find section that says <strong>Add User to Database<\/strong> as shown on the image below<\/div>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate6.png\" alt=\"\" \/><\/li>\n<li>Select user that you want to add (in our case: userdoma_user1)<\/li>\n<li>Select database that you want to add user to (in our case: userdoma_mydb1)<\/li>\n<li>\n<div>Click Add. New page will load titled &#8220;Manage User Privileges&#8221;<\/div>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate7.png\" alt=\"\" \/><\/li>\n<li>On the new page you are able to select permissions for your DB user. We have selected all privileges for our user. Click on Make Changes.<\/li>\n<li>\n<div>New page will appear with result of your action as shown on the image below.<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate8.png\" alt=\"\" \/><\/li>\n<li>Click Go Back button.<\/li>\n<li>\n<div>If you want to check if your user is there just scroll and look for part that says &#8220;Current Databases&#8221; and you will be able to see list of all your databases and users who are allowed to access them as shown on the picture below<\/div>\n<p>&nbsp;<\/p>\n<p><img src=\"https:\/\/servikus.com\/tutorials\/wp-content\/uploads\/2014\/07\/070514_1348_Howtocreate9.png\" alt=\"\" \/><\/li>\n<\/ul>\n<p>That&#8217;s all! You have just learned how to create database in cPanel, add user, and give user privileges to the database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now days almost all websites use MySQL to store information and most of the scripts have auto install options. Anyway, auto install option can&#8217;t create database and user for your database and that is something that you need to do yourself. In this simple tutorial we will show you how to create database and user,&#8230; <a class=\"read-more\" href=\"https:\/\/servikus.com\/tutorials\/how-to-create-database-and-user-for-mysql-and-give-user-permissions-in-cpanell\/\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/69"}],"collection":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":4,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/posts\/69\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/servikus.com\/tutorials\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}