Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import mysql database into mariadb

Tried importing a database backup(.sql) from docker container mysql:5.6 into my local MySQL(MariaDB).

Here is the commands I've used:

mysql -u root -p database_name < /opt/database.sql  
mysql -u root -p  database=database_name </opt/database.sql

Also wanna try mysqlimport but I always encounter the same error.

ERROR 1064 (42000) at line 1: 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 Ver 14.14 Distrib 5.6.33, for Linux (x86_64) using EditLine wrapper Copy' at line 1

Can anyone please tell me what is the right syntax on importing database from mysql into mariadb.

like image 419
Gilroy Avatar asked Sep 30 '16 06:09

Gilroy


1 Answers

You tried to create a dump with mysql command line client instead of mysqldump.

like image 102
Georg Richter Avatar answered Sep 23 '22 04:09

Georg Richter