Bitnami Mantis のDBリストアについて


DBのリストア

テーブルがすでに存在するということで、怒られる

>mysql -u root -p bitnami_mantis < bitnami_mantis.sql
Enter password: ********
ERROR 1050 (42S01) at line 30: Table 'mantis_api_token_table' already exists

DB再作成

DBへ接続、DROP、確認

>mysql -u root -pパスワード
mysql> drop database bitnami_mantis;
Query OK, 32 rows affected (0.36 sec)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.02 sec)
mysql> quit
Bye

DB作成

mysql> create database bitnami_mantis;
Query OK, 1 row affected (0.01 sec)

mysql> quit
Bye

DUMPをリストア

>mysql -u root -pパスワード -D bitnami_mantis < bitnami_mantis.sql
mysql: [Warning] Using a password on the command line interface can be insecure.

#参考)

データのみバックアップ

>mysqldump -u root -pパスワード -t bitnami_mantis > hogehoge.dump

リストア(なんかエラーが出る)

>mysql -u root -p bitnami_mantis < hogehoge.dump
Enter password: ********
ERROR 1062 (23000) at line 33: Duplicate entry '1' for key 'mantis_bug_file_table.PRIMARY'