{"id":50387,"date":"2026-11-20T05:24:08","date_gmt":"2026-11-20T05:24:08","guid":{"rendered":"https:\/\/kickhost.com\/guides\/how-to-add-a-user-to-a-database-and-grant-privileges\/"},"modified":"2026-11-28T08:50:22","modified_gmt":"2026-11-28T08:50:22","slug":"how-to-add-a-user-to-a-database-and-grant-privileges","status":"publish","type":"kickhost_tutorial","link":"https:\/\/kickhost.com\/en-ke\/guides\/how-to-add-a-user-to-a-database-and-grant-privileges\/","title":{"rendered":"How to Add a User to a Database and Grant Privileges"},"content":{"rendered":"<p>A database user needs permission before a website can use a database. In cPanel you link the user to the database and choose the privileges.<\/p>\n<p><strong>1.<\/strong> Log in to your cPanel account.<\/p>\n<p><strong>2.<\/strong> In the <strong>Databases<\/strong> section, click on <strong>MySQL Databases<\/strong>.<br \/> <img decoding=\"async\" src=\"https:\/\/kickhost.com\/img\/mysql-databases-icon.gif\" alt=\"\" align=\"middle\" loading=\"lazy\"><\/p>\n<p><strong>3.<\/strong> Scroll down to the end of the page and under <strong>Add User to Database<\/strong>. Select a user from the drop-down list, and choose a Database from the list.<\/p>\n<p><strong>4.<\/strong> Click on <strong>Add<\/strong>.<br \/><img decoding=\"async\" src=\"https:\/\/kickhost.com\/img\/add-db.gif\" alt=\"\" loading=\"lazy\"><\/p>\n<p><strong>5.<\/strong> On <strong>Manage User Privileges<\/strong>. Mark the box <strong>ALL PRIVILEGES<\/strong> and click on <strong>Make Changes<\/strong>.<br \/><img decoding=\"async\" src=\"https:\/\/kickhost.com\/img\/add-privileges.gif\" alt=\"\" loading=\"lazy\"><\/p>\n<h2>Which privileges to choose<\/h2>\n<p>Most websites such as WordPress need ALL PRIVILEGES. For limited tasks, you can grant fewer privileges for better security.<\/p>\n<h2>Update your configuration<\/h2>\n<p>After linking, put the database name, username and password in your website configuration file, for example wp-config.php for WordPress.<\/p>\n<h2>Frequently asked questions<\/h2>\n<p><strong>Why do I get a database connection error?<\/strong> Check the database name, username and password. Both name and user usually start with your cPanel username prefix.<\/p>\n<p><strong>Can one user access several databases?<\/strong> Yes. Add the user to each database you want it to use.<\/p>\n<h2>Related guides<\/h2>\n<ul>\n<li><a href=\"https:\/\/kickhost.com\/en-ke\/guides\/how-to-export-database-table-via-phpmyadmin-in-cpanel\/\">Export a database table<\/a><\/li>\n<li><a href=\"https:\/\/kickhost.com\/en-ke\/guides\/how-to-repair-a-database-via-phpmyadmin-in-cpanel\/\">Repair a database in phpMyAdmin<\/a><\/li>\n<\/ul>\n<p>Need cPanel hosting in Kenya? <a href=\"https:\/\/kickhost.com\/en-ke\/web-hosting\/\">See KickHost hosting plans<\/a> or <a href=\"https:\/\/kickhost.com\/en-ke\/contact\/\">contact our team<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Add a database user to a database and grant privileges in cPanel. Steps for KickHost customers in Kenya.<\/p>\n","protected":false},"featured_media":0,"template":"","class_list":["post-50387","kickhost_tutorial","type-kickhost_tutorial","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/kickhost_tutorial\/50387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/kickhost_tutorial"}],"about":[{"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/types\/kickhost_tutorial"}],"version-history":[{"count":2,"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/kickhost_tutorial\/50387\/revisions"}],"predecessor-version":[{"id":53364,"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/kickhost_tutorial\/50387\/revisions\/53364"}],"wp:attachment":[{"href":"https:\/\/kickhost.com\/en-ke\/wp-json\/wp\/v2\/media?parent=50387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}