Home > other >  import mysql data dump to Maria DB
import mysql data dump to Maria DB

Time:09-23

I am trying to import mysql data dump to Maria DB with below command

mysql -u root -p --one-database new_db < data_dump.sql;

But I am getting below error

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mysql -u root -p --one-database zapcheck < zapcheck.sql' at line 1

I tried different combinations but nothing worked. Its not even telling what's the issue.

enter image description here

Please let me know the issue here or is there any other way I can import?

CodePudding user response:

You can try the command below to import the file:

Note: Open the terminal where dump.sql is located

After opening the terminal:

//Skip this process if you have already created a database.
Mysql> create database newdb;

// Using the new created database
Mysql> use newdb;

// Importing the dump.sql file to newdb database
Mysql> source dump.sql
  • Related