백업
$ mysqldump -u ID -p DBNAME (TABLENAME) > FILEPATH
ex)
$ mysqldump -u userid -p testdb > testdb.dump
Lock Tables 에러
mysqldump: Got error: 1044: Access denied for user 'userid '@'localhost' to database 'testdb' when using LOCK TABLES
--lock-all-tables 옵션을 주면 된다:
$ mysqldump -u userid -p --lock-all-tables testdb > testdb.dump
복구
$ mysql -u ID -p DBNAME (TABLENAME) < FILEPATH
ex)
$ mysql -u userid -p testdb < testdb.dump
0 comments:
Post a Comment