3

I'm trying to restore the empty DB for mydb table but the syntax of mysqlimport doesn't seem to be straight forward. I had earlier created the file emptyDbs when doing a mysqldump.

mysqlimport mydb/var/tmp/emptyDbs
Ashutosh
  • 518
  • 7
  • 20
R F
  • 111
  • 1
  • 6
  • You simple need to call, `mysql` command. – Red Boy Sep 30 '18 at 16:25
  • Still a problem.. echo "mysqlimport mydb /var/tmp/emptyDbs" | mysql statsdb 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 'mysqlimport /var/tmp/emptyDbs' at line 1 – R F Sep 30 '18 at 16:27
  • Use `mysql < file_to_import.sql` – Red Boy Sep 30 '18 at 16:29
  • 1
    You could refer https://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql for more details – Red Boy Sep 30 '18 at 16:31

1 Answers1

1
 mysql statsdb < /var/tmp/emptyDbs
R F
  • 111
  • 1
  • 6