Recent Posts
변군이글루
[AWS] rds mysql(mariadb) 데이터베이스 마이그레이션 본문
mysql 데이터베이스 마이그레이션
[소스 데이터베이스(sdb.sangchul.kr)]
데이터베이스 접속 테스트
$ mysql -hsdb.sangchul.kr -umyuser -p'mypassword1!' mydata_DB
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 123456789
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
AWS RDS 데이터 익스포트(Export)
$ mysqldump -hsdb.sangchul.kr -umyuser -p'mypassword1!' --databases mydata_DB > mydata_DB_20201020.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions,
even those that changed suppressed parts of the database.
If you don't want to restore GTIDs, pass --set-gtid-purged=OFF.
To make a complete dump, pass --all-databases --triggers --routines --events.
[타켓 데이터베이스(tdb.sangchul.kr)]
데이터베이스 접속 테스트
$ mysql -htdb.sangchul.kr -umyuser -p'mypassword1!'
DB(mydata_DB) 생성
$ mysqladmin -htdb.sangchul.kr -umyuser -p'mypassword1!' create mydata_DB
익스포트(Export)한 sql 파일(mydata_DB_20201020.sql)을 임포트(Import)
$ mysql -htdb.sangchul.kr -umyuser -p'mypassword1!' mydata_DB < mydata_DB_20201020.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
임포트(Import)한 데이터베이스 테이블 확인
mysql> show tables from mydata_DB;
'* 퍼블릭 클라우드' 카테고리의 다른 글
[AWS] Amazon Route 53 호스트 영역 등록 (0) | 2020.11.09 |
---|---|
[AWS] ec2 인스턴스 리스트 출력 (0) | 2020.10.21 |
[AWS] rds mysql(mariadb) 데이터베이스 마이그레이션 (0) | 2020.10.20 |
[AWS] ELB(ALB) 로그를 S3에 저장하기 (0) | 2020.10.13 |
[AWS] CloudWatch slack 메시지 포맷 편집 (0) | 2020.10.11 |
[AWS] RDS(MySQL) 읽기 전용 복제본 디비 생성 (0) | 2020.10.08 |
0 Comments