importing backup by Mariadb terminal

Asked

Viewed 26 times

0

Yesterday I was doing a test in Postgresql of insertion and backup import and export and Postgresql has an SQL import command as follows:

psql# \i backup.sql

Has something to do with that in MariaDB(MySQL) apart from being like Plain by the terminal of the same?

MariaDB [teste]> ?

1 answer

2


In the Mariadb you can use the source or simply \. to run a file .sql, for example:

MariaDB> source file.sql

MariaDB> \. file2.sql

There are other ways to execute a script also:

user@pc: mysql -u USUARIO -p < file.sql

You can also use the mysqlimport, for example:

user@pc: mysqlimport [OPTIONS] DATABASE file.sql file2.sql ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.