본문 바로가기

리눅스

[리눅스] MySQL/MariaDB DB 백업/복구(export/import)하기

728x90

MySQL/MariaDB DB 백업/복구(export/import)하기

백업(Export)

mysqldump -u [user name] –p [password] [options] [database_name] > [dumpfilename.sql]
$ mysqldump -u root -p'dbpassword' my_DB > dumpfile_my_DB.sql

복구(Import)

mysql -u [user name] –p [password] [options] [database_name] < [dumpfilename.sql]
$ mysql -u root -p'dbpassword' my_DB < dumpfile_my_DB.sql
728x90