Development and databases
Use phpMyAdmin to query, export and import databases
phpMyAdmin lets you work with the tables and records of your databases from the browser. You can query data, run SQL and import or export a dump. At Hostsuar you open it from cPanel > Databases > phpMyAdmin.
Databases and users on the hosting are managed in cPanel's Manage My Databases, called MySQL Databases in older versions. Create the database and assign the user there so that cPanel keeps its link to the account correctly.
Open the right database
- Log in to cPanel from the hosting service and open phpMyAdmin.
- Select the database in the side column. Check its full name, including the account prefix.
- Open a table and use Browse to see its records or Structure to review columns and indexes.
- To run a query, open SQL inside the selected database and review the statement before you continue.
If you do not know which database a website uses, check its configuration file, for example DB_NAME in wp-config.php. Do not try out changes on different databases until you hit the right one.
Empty deletes a table's records; Drop also deletes its structure. A confirmation in the interface is no substitute for a restorable backup. Start with a SELECT query if you only need to check information.
Export an SQL backup
Select the database and open Export. Quick mode, with SQL format, is fine for a standard dump; Custom lets you choose tables, compression and structure and data options.
Check that the export includes all the tables and objects your application needs. Some operations on views, triggers, routines or events depend on privileges and on the server configuration. Do not assume a file is complete just because it downloaded: check that it is not empty and do a trial import into a test database.
If the application receives writes during the export, plan how to get a consistent copy. For data that changes constantly or large databases, use a backup procedure suited to their engines and size.
Keep the SQL file outside the public folder and download it to protected storage. It may contain personal data and application secrets.
Import into an empty database
- Create a new database in cPanel and assign a user with the privileges needed.
- Open it in phpMyAdmin and check that it is the intended target.
- In Import, select the SQL file or a compressed format supported on that screen.
- Review the encoding and options; start the import and wait for the result.
- Check tables, row counts and a sample of data. Then test the application with that database.
Review the dump first: CREATE DATABASE, USE or DROP TABLE statements, or references to another database, can cause conflicts, change the target or delete tables. Do not import over production to see whether the file works.
The upload limit is shown in Import. Compressing the file can reduce the transfer, but it does not avoid time or resource limits when the SQL runs. For large files, see importing from the terminal and prepare the command with the correct target name.
If the import fails halfway, it may leave tables already created or data partly loaded. Read the first error and try again on an empty database; repeating without checking can duplicate records or fail because objects already exist.
Other features
The Designer shows tables and relationships when its configuration is available. The user's privileges and phpMyAdmin's configuration storage determine some advanced features. An option appearing in another installation does not mean it is enabled on your account.
To copy an existing installation, follow the guide to cloning databases. See also the scope of phpMyAdmin in cPanel.
You may also find useful
- phpMyAdmin separate from cPanel Install phpMyAdmin outside cPanel only temporarily, protect it with HTTPS and IP restrictions, and l...
- Check your MySQL version and compatibility Identify the actual version of the MySQL server your application uses, review compatibility and tell...
- Clone a database Duplicate a MySQL database by first creating the destination and its permissions in cPanel, then cop...
- Convert a MyISAM database to InnoDB by changing the storage engine Convert MyISAM tables to InnoDB on a verified clone, check space, indexes and rows, and keep the ori...
Something wrong or out of date? Tell us and we will review it.