MySQL/MariaDB数据库备份sql文件及恢复

数据备份

执行 mysqldump 命令:

$sudo mysqldump -u root --databases dbname --lock-all-tables --flush-logs > ~/sqlfilename.sql

还原数据库:

MariaDB [dbname]> source ~/sqlfilename.sql

Comments are closed.