How to import a MySQL/MariaDB Database

June 19, 2023 / MySQL

This guide explains how to import a MySQL/MariaDB database.

Follow the steps:

  1. To import MySQL/MariaDB database file, first you will have to add an empty database. Log in to MySQL/MariaDB database using the following command-
    mysql -u root –p
  2. Enter the root password and create database-
    CREATE DATABASE [database name];
  3. Now, to quit; log out of the client area using the below command-
    quit;
  4. You can now import the database file by executing the command given below-
    mysql -u [username] -p [new database name] < [.sql dump file name]

Hope you liked this KB. If you want to know more on web hosting, visit our KB section regularly. Also, never hesitate to get in touch with our support specialists.

Dominos Search