x

New NFT's Just Minted!

How to Import a sql dump file in mariaDB or mySQL

How to Import a sql dump file in mariaDB or mySQL

To import an existing dump file into MySQL or MariaDB, you will have to create a new database. This database will hold the imported data.

First, log in to MySQL as root or another user with sufficient privileges to create new databases:

mysql -u root -p

Next, create a new database with the following command. In this example, the new database is called new_database:

CREATE DATABASE new_database;

Then exit the MySQL shell by pressing CTRL+D. From the normal command line, you can import the dump file with the following command:

mysql -u username -p new_database < dump.sql

username is the username you can log in to the database with

new_database is the name of the freshly created database

dump.sql is the data dump file to be imported, located in the current directory

If the command runs successfully, it won’t produce any output. If any errors occur during the process, mysql will print them to the terminal instead.

To check if the import was successful, log in to the MySQL shell and double check the database. Select the new database with USE new_database and then use SHOW TABLES;


Posted by: admin
2023-10-25 14:13:00

© Autonetix.co - All rights reserved | 2022 - 2025

Go To Top 

Our Sites

Autonetix.co CouchCoins.com.au