Articles on: Linux

How Do I Restore a Mysqldump File

Access to mysql cli

cPanel: MySQL

Directadmin: search for mysql root password in Directadmin server /usr/local/directadmin/scripts/setup.txt then run command below

mysql -u root -p

Once you access to mysql cli, you need see something below:

mysql >

Now select which database you want to use

mysql> use db_name;

Now restore the database from mysqlexample.sql. Please make sure before you went into mysql cli, you are that the path that contain that mysqlexample.sql

mysql> source mysqlexample.sql;

Then exit.

mysql > exit;

Updated on: 07/01/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!