{"id":74,"date":"2026-05-13T18:32:27","date_gmt":"2026-05-14T01:32:27","guid":{"rendered":"https:\/\/cpanelreview.com\/index.php\/2026\/05\/13\/create-manage-mysql-databases-cpanel-guide\/"},"modified":"2026-05-13T18:32:34","modified_gmt":"2026-05-14T01:32:34","slug":"create-manage-mysql-databases-cpanel-guide","status":"publish","type":"post","link":"https:\/\/cpanelreview.com\/index.php\/2026\/05\/13\/create-manage-mysql-databases-cpanel-guide\/","title":{"rendered":"How to Create and Manage MySQL Databases in cPanel: A Complete Guide"},"content":{"rendered":"<p>If you run a WordPress site, a custom PHP application, or any dynamic website on a cPanel server, your content, user data, and configuration settings live inside MySQL or MariaDB databases. Knowing how to create, manage, and secure these databases from within cPanel is one of the most fundamental skills a site owner can develop.<\/p>\n<p>cPanel&#8217;s MySQL management tools \u2014 <strong>MySQL Databases<\/strong> and <strong>phpMyAdmin<\/strong> \u2014 give you full control over database creation, user permissions, and direct table queries without needing command-line access. In this guide, you will learn how to create databases and users, assign privileges, import and export data, and follow security best practices to keep your database layer hardened.<\/p>\n<p><!--more--><\/p>\n<h2>Creating a MySQL Database and User in cPanel<\/h2>\n<p>Every web application needs at least one database and one database user. cPanel separates these steps cleanly so you can control exactly which user has access to which database.<\/p>\n<h3>Step 1: Create the Database<\/h3>\n<ol>\n<li>Log into your cPanel dashboard (usually <code>https:\/\/yourdomain.com:2083<\/code>).<\/li>\n<li>Scroll to the <strong>Databases<\/strong> section and click <strong>MySQL Databases<\/strong>.<\/li>\n<li>Under <strong>Create New Database<\/strong>, enter a name for your database. cPanel will prefix it with your account username (for example, <code>yoursite_wpdb<\/code>).<\/li>\n<li>Click <strong>Create Database<\/strong>. A confirmation message will appear.<\/li>\n<li>Click <strong>Go Back<\/strong> to return to the main MySQL Databases page.<\/li>\n<\/ol>\n<h3>Step 2: Create a Database User<\/h3>\n<ol>\n<li>In the <strong>MySQL Users<\/strong> section, enter a username and a strong password. Use the password generator for a 16+ character combination of letters, numbers, and symbols.<\/li>\n<li>Click <strong>Create User<\/strong>.<\/li>\n<\/ol>\n<h3>Step 3: Assign the User to the Database<\/h3>\n<ol>\n<li>In the <strong>Add User to Database<\/strong> section, select the user and database you just created from the dropdown menus.<\/li>\n<li>You will be taken to the <strong>Manage User Privileges<\/strong> page.<\/li>\n<li>For most web applications (WordPress, Laravel, Joomla), select <strong>All Privileges<\/strong>. For custom applications, grant only the privileges the app needs (<code>SELECT<\/code>, <code>INSERT<\/code>, <code>UPDATE<\/code>, <code>DELETE<\/code>, <code>CREATE<\/code>, <code>ALTER<\/code>, <code>INDEX<\/code>, <code>DROP<\/code> are the minimum for a typical CMS).<\/li>\n<li>Click <strong>Make Changes<\/strong>.<\/li>\n<\/ol>\n<p>Your database is now live. You can find its connection details \u2014 database name, username, and password \u2014 and use them in your application&#8217;s configuration file (such as <code>wp-config.php<\/code> for WordPress).<\/p>\n<h2>Managing Databases with phpMyAdmin<\/h2>\n<p>phpMyAdmin is a browser-based MySQL administration tool included with every cPanel installation. It lets you run SQL queries, browse tables, and perform bulk operations without writing a single line of code.<\/p>\n<h3>Accessing phpMyAdmin<\/h3>\n<ol>\n<li>In cPanel&#8217;s <strong>Databases<\/strong> section, click <strong>phpMyAdmin<\/strong>.<\/li>\n<li>A new tab opens showing the phpMyAdmin interface. Your databases are listed in the left sidebar.<\/li>\n<li>Click any database name to see its tables.<\/li>\n<\/ol>\n<h3>Common Operations in phpMyAdmin<\/h3>\n<ul>\n<li><strong>Browse data:<\/strong> Click a table name, then click the <strong>Browse<\/strong> tab to view rows.<\/li>\n<li><strong>Run SQL queries:<\/strong> Click the <strong>SQL<\/strong> tab and enter your query (for example: <code>SELECT * FROM wp_options WHERE option_name = 'siteurl';<\/code>).<\/li>\n<li><strong>Search across tables:<\/strong> Use the <strong>Search<\/strong> tab to find text inside a table&#8217;s data.<\/li>\n<li><strong>Repair or optimize tables:<\/strong> Select one or more tables, then use the dropdown below to choose <strong>Repair table<\/strong> or <strong>Optimize table<\/strong>.<\/li>\n<\/ul>\n<p>Be cautious when making changes through phpMyAdmin. A single <code>DROP TABLE<\/code> or <code>DELETE<\/code> query without a proper <code>WHERE<\/code> clause can destroy data permanently. Always take a backup before running manual queries on a production database.<\/p>\n<h2>Importing and Exporting MySQL Databases<\/h2>\n<p>Moving databases between servers, restoring backups, or setting up local development copies all require reliable import and export workflows.<\/p>\n<h3>Exporting a Database (Backup)<\/h3>\n<ol>\n<li>Open phpMyAdmin and click the database you want to export from the left sidebar.<\/li>\n<li>Click the <strong>Export<\/strong> tab at the top.<\/li>\n<li>Choose <strong>Quick<\/strong> for a full export of all tables, or <strong>Custom<\/strong> to select specific tables.<\/li>\n<li>Ensure the format is set to <strong>SQL<\/strong> (this produces a <code>.sql<\/code> file).<\/li>\n<li>Click <strong>Go<\/strong>. Your browser will download the file.<\/li>\n<\/ol>\n<h3>Importing a Database (Restore)<\/h3>\n<ol>\n<li>Create an empty database in cPanel&#8217;s MySQL Databases section (do not add any tables).<\/li>\n<li>Open phpMyAdmin and select the empty database from the left sidebar.<\/li>\n<li>Click the <strong>Import<\/strong> tab.<\/li>\n<li>Click <strong>Choose File<\/strong> and select your <code>.sql<\/code> file. Files under 2 MB upload directly; for larger files, compress the SQL file as a <code>.zip<\/code> or <code>.gz<\/code> first.<\/li>\n<li>Click <strong>Go<\/strong>. phpMyAdmin will execute the SQL statements and recreate the tables and data.<\/li>\n<\/ol>\n<p>If you encounter a <strong>&#8220;max_allowed_packet&#8221;<\/strong> or timeout error during import, ask your hosting provider to increase the limit in <code>my.cnf<\/code>, or split the SQL file into smaller chunks using a tool like <code>split<\/code> on the command line.<\/p>\n<h2>Resetting a MySQL Password in cPanel<\/h2>\n<p>Forgotten database passwords happen more often than you might expect. Fortunately, cPanel makes it simple to reset them without losing data.<\/p>\n<ol>\n<li>In cPanel, go to <strong>MySQL Databases<\/strong>.<\/li>\n<li>Scroll to the <strong>Current Users<\/strong> section.<\/li>\n<li>Find the user whose password needs resetting and click <strong>Change Password<\/strong>.<\/li>\n<li>Enter a new strong password or use the generator.<\/li>\n<li>Click <strong>Change Password<\/strong> to save.<\/li>\n<\/ol>\n<p><strong>Important:<\/strong> After resetting the password, update your application&#8217;s configuration file (like <code>wp-config.php<\/code>) with the new password. Your site will throw database connection errors until the credentials match.<\/p>\n<h2>MySQL Security Best Practices for cPanel Users<\/h2>\n<p>Databases are a prime target for attackers. A compromised database can leak customer information, user credentials, and payment data. Here is how to lock yours down.<\/p>\n<h3>Use Separate Users and Databases Per Application<\/h3>\n<p>Never reuse the same database user across multiple websites. If one site gets compromised, the attacker can pivot to every database the user has access to. cPanel makes it easy to create dedicated users per application \u2014 take advantage of it.<\/p>\n<h3>Grant Minimal Privileges<\/h3>\n<p>Do not give <strong>All Privileges<\/strong> unless the application genuinely needs it. For a read-only reporting tool, grant only <code>SELECT<\/code>. For a CMS, the standard <code>SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP<\/code> set is usually enough. Avoid granting <code>SUPER<\/code> or <code>FILE<\/code> privileges to routine application users.<\/p>\n<h3>Use Strong, Unique Passwords<\/h3>\n<p>cPanel includes a password generator for a reason. Database passwords should be at least 16 characters with a mix of cases, numbers, and symbols. Never use passwords shared with your email or cPanel login.<\/p>\n<h3>Change the Database Prefix<\/h3>\n<p>WordPress databases use the <code>wp_<\/code> table prefix by default. Change it during installation (to something like <code>site3_<\/code> or <code>xyz123_<\/code>) to protect against SQL injection attacks that assume the default prefix.<\/p>\n<h3>Regular Backups<\/h3>\n<p>Schedule automated backups of your MySQL databases. Most cPanel hosting plans include a backup tool that can create daily or weekly database dumps. Store copies off-site \u2014 a database backup on the same server is useless if the server itself goes down.<\/p>\n<h2>Key Takeaways<\/h2>\n<ul>\n<li>cPanel&#8217;s MySQL Database Manager and phpMyAdmin let you handle all database operations \u2014 creation, user management, import\/export, and table manipulation \u2014 entirely from a browser.<\/li>\n<li>Always create a separate database user for each application and grant only the privileges that application requires.<\/li>\n<li>Use phpMyAdmin&#8217;s Export feature for quick database backups before making structural changes.<\/li>\n<li>Reset forgotten MySQL passwords through the MySQL Databases page, then update your application config file immediately.<\/li>\n<li>Compress large SQL files as <code>.zip<\/code> or <code>.gz<\/code> before importing to avoid phpMyAdmin upload limits.<\/li>\n<li>Security fundamentals \u2014 unique users, minimal privileges, strong passwords, and regular off-site backups \u2014 are the most effective defense against database-level attacks.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>If you run a WordPress site, a custom PHP application, or any dynamic website on a cPanel server, your content, user data, and configuration settings live inside MySQL or MariaDB databases. Knowing how to create, manage, and secure these databases from within cPanel is one of the most fundamental skills a site owner can develop. &#8230; <a title=\"How to Create and Manage MySQL Databases in cPanel: A Complete Guide\" class=\"read-more\" href=\"https:\/\/cpanelreview.com\/index.php\/2026\/05\/13\/create-manage-mysql-databases-cpanel-guide\/\" aria-label=\"Read more about How to Create and Manage MySQL Databases in cPanel: A Complete Guide\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110],"tags":[3,201,202,112,200],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-database-management","tag-cpanel","tag-database-security-cpanel","tag-mysql-backup-cpanel","tag-mysql-database-management","tag-phpmyadmin"],"_links":{"self":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":1,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}