From command line
Command line MySQL import (Mariadb is a FREE Mysql)
- Type: mysql -u username -p database_name < file.sql.
- The username refers to your MySQL username.
- database_name refers to the database you want to import.
- file. sql is your file name.
- If you've assigned a password, type it now and press Enter.
You can also import, using tools, like phpadmin
Importing to MySQL/MariaDB Databases with phpMyAdmin
- Open the target database for editing with phpMyAdmin.
- Click Import in the menu bar. ...
- In the File to import: section, click Select file and select your backup file.
- Specify the desired import settings. ...
- Click OK to start the import.
Another way is to write programs in a language like PHP.