For importing a database, we alsouse the mysqldump command or the MySQL Workbench.
In the MySQL Workbench go to Server and select the import option.
This opens the Import utility. In the Import utility, we need to select the folder with the dump file. After selecting the Folder, click on the “Load contents” button. This will load all the dump files we have present in the folder.
If the dump file contains only the data but not the schema name, we need to specify the schema_name. Otherwise, the schema name is not necessary. Once we select all the options necessary, we can just click on the “Start import” button and the database schema will be loaded into our database for us.
To import a database using the command-line client, we do the following.
mysql -u [username] -p [database-name] < [Dump file name and location]
mysql -u root -p testing < C:\dumps\sakila_dump.sql
This prompts you for the password. Then based on the dump file, the database data is imported into the new database.