MariaDB - How to Restore .sql file to Database in MariaDB or MySQL


In our last post we created the logical backups of a database by using mysqldump. Now we need to restore that .SQL file to database.


Login to MariaDB or MySQL database. Create an empty Database by using "create database DatabaseName" statement. In my case I create database ABC.

Fig 1: Create database in MariaDB or MySQL

Once you exited form MariaDB or MYSQL, on Shell provide below statement to restore .sql file to database. In my case I used empty database ABC.

shell> mysql -u root -p DatabaseName< sqlfile.sql