This article provides a guide for how to import a large database in cPanel using SSH. This technique is helpful with a database that is too big to import using phpMyAdmin's web interface.
How to Import a Large Database in cPanel Using SSH
To import a large database in cPanel using SSH, follow the steps below:
- Login to the cPanel server via SSH console.
- Run the following command:
(Replace 'user_name' with the database user, 'database_name' with the database name, and 'file.sql' with the with the actual file name including relative file location.)mysql -p -u user_name database_name < file.sql
- Enter the database user password and click "Enter/Return" to submit.
- This process may take some time, depending on how large the database is. When the import is complete, the SSH terminal will return "
[user@server ~] $
" default prefix.
Conclusion
You now know how to import a large database in cPanel using SSH (phpMyAdmin workaround).