{"id":29996,"date":"2021-01-18T02:48:50","date_gmt":"2021-01-17T18:48:50","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=29996"},"modified":"2022-09-08T21:36:41","modified_gmt":"2022-09-08T13:36:41","slug":"how-to-manage-databases-and-database-users-in-cpanel","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-manage-databases-and-database-users-in-cpanel","title":{"rendered":"HOW TO: Manage databases and database users in cPanel"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"29996\" class=\"elementor elementor-29996\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c394d0e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c394d0e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-48f6fdc\" data-id=\"48f6fdc\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f4997ba elementor-widget elementor-widget-heading\" data-id=\"f4997ba\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">MANAGING DATABASES<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2af9701 elementor-widget elementor-widget-heading\" data-id=\"2af9701\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Creating Database<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-354d68b elementor-widget elementor-widget-text-editor\" data-id=\"354d68b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To create a MySQL database, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases i<\/strong>n the <strong>Databases<\/strong> section of the cPanel home screen.<\/li><li>Next, type the name of the database in the <strong>New Databasetext<\/strong> box under <strong>Create New Database<\/strong>.<\/li><li>Lastly, click <strong>Create Database<\/strong>.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b858a30 elementor-widget elementor-widget-heading\" data-id=\"b858a30\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Adding a user to a database<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a1f2f8b elementor-widget elementor-widget-text-editor\" data-id=\"a1f2f8b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To add a MySQL user to a database, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases<\/strong> in the <strong>Databases<\/strong> section of the cPanel home screen.<\/li><li>Under\u00a0<strong>Add User to Database<\/strong>, select the user that you want to add in the\u00a0<strong>User\u00a0list<\/strong> box.<\/li><li>In the<strong>\u00a0Database\u00a0list<\/strong> box, select the database.<\/li><li>Then, click <strong>Add<\/strong> checkbox to grant the user specific privileges, or click the <strong>ALL PRIVILEGES<\/strong> checkbox to grant the user all permissions to the database.<\/li><li>Lastly, click <strong>Make Changes<\/strong>.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6a45bf4 elementor-widget elementor-widget-heading\" data-id=\"6a45bf4\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Checking and repairing a database<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1655198 elementor-widget elementor-widget-text-editor\" data-id=\"1655198\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>However, you can check MySQL databases for<strong> errors or possible corruption<\/strong>. If a database check reveals problems, you can repair the database as well.<\/p><p>To check and repair a database, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases <\/strong>under the <strong>Databases<\/strong> section of the cPanel home screen.<br \/><br \/><\/li><li>To <strong>check a database<\/strong>:<ul><li>Under\u00a0<strong>Modify Databases<\/strong>, select the database in the\u00a0<strong>Check DB\u00a0list<\/strong> box.<\/li><li>Click\u00a0<strong>Check DB<\/strong>.<\/li><\/ul><\/li><li>If a database check indicates problems with a database, you can <strong>repair<\/strong> it:<ul><li>Under\u00a0<strong>Modify Databases<\/strong>, select the database in the\u00a0<strong>Repair DB\u00a0list<\/strong> box.<\/li><li>Click\u00a0<strong>Repair DB<\/strong>.<\/li><\/ul><\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b6c362e elementor-widget elementor-widget-heading\" data-id=\"b6c362e\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Removing a user from a database<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d2cd555 elementor-widget elementor-widget-text-editor\" data-id=\"d2cd555\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>When you remove a user from a database, the user can no longer access the database.<\/p><p>To <strong>remove a MySQL user<\/strong> from a database, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases<\/strong> in the <strong>Databases<\/strong> section of the cPanel home screen.<\/li><li>Next, locate the user that you want to remove under <strong>Current Databases<\/strong>, and then click the <strong>red X icon<\/strong>.<\/li><li>Lastly, click <strong>Delete User from Database<\/strong> to confirm the deletion.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-776d4b9 elementor-widget elementor-widget-heading\" data-id=\"776d4b9\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Deleting a database<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-33dff59 elementor-widget elementor-widget-text-editor\" data-id=\"33dff59\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Before you delete a database, make sure that you have a <strong>backup copy<\/strong> if you want to save any information that it contains.<\/p><p>To delete a MySQL database, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases<\/strong> in the <strong>Databases<\/strong> section of the cPanel home screen.<\/li><li>Secondly, locate the database that you want to delete under <strong>Current Databases<\/strong>, and then click <strong>Delete Database<\/strong>.<\/li><li>Lastly, click <strong>Delete Database<\/strong> to confirm the deletion.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6a029c1 elementor-widget elementor-widget-heading\" data-id=\"6a029c1\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">MANAGING DATABASE USERS<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-83a145a elementor-widget elementor-widget-text-editor\" data-id=\"83a145a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To access MySQL databases, you must first create <strong>at least one user<\/strong>. The following procedures describe how to manage MySQL database users using cPanel.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-de9ea10 elementor-widget elementor-widget-heading\" data-id=\"de9ea10\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Creating a database user<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6c80238 elementor-widget elementor-widget-text-editor\" data-id=\"6c80238\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To create a MySQL database user, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases<\/strong> in the <strong>Databases<\/strong> section of the cPanel home screen,.<\/li><li>Under\u00a0<strong>Add New User<\/strong>, type the MySQL username in the\u00a0<strong>Username\u00a0<\/strong>text box.<\/li><li>Then, type the user password in the <strong>Password<\/strong> text box.<\/li><li>In the\u00a0<strong>Password (Again)<\/strong>\u00a0text box, retype the user password.<\/li><li>Lastly, click <strong>Create User<\/strong>.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e157c40 elementor-widget elementor-widget-heading\" data-id=\"e157c40\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Changing a user\u2019s password<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1fd7600 elementor-widget elementor-widget-text-editor\" data-id=\"1fd7600\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>In other words, you can change a database user\u2019s password. You may want to do this for <strong>security<\/strong> reasons (changing passwords periodically is a good security practice), or you may need to do this if you forget the password.<\/p><p>To change a MySQL user\u2019s password, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>In the\u00a0<strong>Databases\u00a0<\/strong>section of the cPanel home screen, click\u00a0<strong>MySQL\u00ae Databases<\/strong>.<\/li><li>Next, locate the user for which you want to change the password under <strong>Current Users<\/strong>, and then click<strong> Set Password<\/strong>.<\/li><li>In the <strong>Password<\/strong> and <strong>Password (Again)<\/strong> text boxes, type the new password.<\/li><li>Lastly, click <strong>Change Password<\/strong>. The new password takes effect immediately.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-97e3a34 elementor-widget elementor-widget-heading\" data-id=\"97e3a34\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Renaming a user<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-874c60c elementor-widget elementor-widget-text-editor\" data-id=\"874c60c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To rename a MySQL user, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>Firstly, click <strong>MySQL\u00ae Databases<\/strong> in the <strong>Databases<\/strong> section of the cPanel home screen.<\/li><li>Then, locate the user that you want to rename under <strong>Current Users<\/strong>, and click <strong>Rename<\/strong>.<\/li><li>In the text box, type the new name, and then click\u00a0<strong>Proceed<\/strong>.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-84738bf elementor-widget elementor-widget-heading\" data-id=\"84738bf\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Deleting a user<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c0ad7df elementor-widget elementor-widget-text-editor\" data-id=\"c0ad7df\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>When you delete a user, the user and its database permissions are deleted.<\/p><p>To delete a MySQL user, follow these steps:<\/p><ol><li style=\"list-style-type: none;\"><ol><li>In the\u00a0<strong>Databases\u00a0<\/strong>section of the cPanel home screen, click\u00a0<strong>MySQL\u00ae Databases<\/strong>.<\/li><li>Next, locate the user that you want to delete under <strong>Current Users<\/strong>, and then click the <strong>red X icon<\/strong>.<\/li><li>Lastly, click <strong>Delete User<\/strong> to confirm the deletion.<\/li><\/ol><\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a1f90e6 elementor-widget elementor-widget-text-editor\" data-id=\"a1f90e6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Check out the next article on <a href=\"https:\/\/www.casbay.com\/guide\/kb\/how-to-disable-directory-browsing\/\">HOW TO: disable directory browsing<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>MANAGING DATABASES Creating Database To create a MySQL database, follow these steps: Firstly, click MySQL\u00ae Databases in the Databases section of the cPanel home screen. Next, type the name of the database in the New Databasetext box under Create New Database. Lastly, click Create Database. Adding a user to a database To add a MySQL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[117],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/29996"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=29996"}],"version-history":[{"count":1,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/29996\/revisions"}],"predecessor-version":[{"id":31930,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/29996\/revisions\/31930"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=29996"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=29996"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=29996"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=29996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}