โAWS RDS ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ฐฑ์
์ ์๋ ์ต์
์ถ๊ฐ.
mysqldump --set-gtid-purged=OFF -h <hostname> -P <port> -u <user๋ช
> -p <database name> <file name>.sql
$ mysqldump --set-gtid-purged=OFF -h "database-1.cyxirxsmjvie.ap-northeast-1.rds.amazonaws.com" -P 3306 -u
admin -p zerobase > backup_zerobase.sql;
+default character set utf8mb4
mysql> create database zerodb default character set utf8mb4;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| zerobase |
| zerodb |
+--------------------+
mysql> grant all on zerodb.* to 'zero'@'%';
mysql> show grants for 'zero'@'%';
+----------------------------------------------------+
| Grants for zero@% |
+----------------------------------------------------+
| GRANT USAGE ON *.* TO `zero`@`%` |
| GRANT ALL PRIVILEGES ON `zerobase`.* TO `zero`@`%` |
| GRANT ALL PRIVILEGES ON `zerodb`.* TO `zero`@`%` |
+----------------------------------------------------+
mysql> source backup_zerobase.sql;
mysql> show tables;
+------------------+
| Tables_in_zerodb |
+------------------+
| celeb |
| crime_status |
| oil_price |
| police_station |
| snl_show |
+------------------+
INSERT INTO police_station VALUES('์์ธํน๋ณ์๊ฒฝ์ฐฐ์ฒญ','์์ธ์ ์ข
๋ก๊ตฌ ์ฌ์ง๋ก8๊ธธ 31');
INSERT INTO police_station VALUES('์์ธ์ค๋ถ๊ฒฝ์ฐฐ์','์์ธํน๋ณ์ ์ค๊ตฌ ์ํ๋ก 27');
INSERT INTO police_station VALUES('์์ธ์ข
๋ก๊ฒฝ์ฐฐ์','์์ธํน๋ณ์ ์ข
๋ก๊ตฌ ์จ๊ณก๋ก 46');
INSERT INTO police_station VALUES('์์ธ๋จ๋๋ฌธ๊ฒฝ์ฐฐ์','์์ธํน๋ณ์ ์ค๊ตฌ ํ๊ฐ๋๋ก 410');
mysql> source insert.sql;
mysql> select * from police_station;
>mysqldump --set-gtid-purged=OFF -h "database-1.cyxirxsmjvie.ap-northeast-1.rds.amazonaws.com" -P 3306 -u
admin -p zerobase police_station > backup_police.sql;