$30 off During Our Annual Pro Sale. View Details »

Accessing RDS from local

Accessing RDS from local

thanhgit

May 03, 2022
Tweet

More Decks by thanhgit

Other Decks in Technology

Transcript

  1. Cách truy cập RDS từ
    local
    By Thanh Nguyen

    View Slide

  2. Điều kiện
    - Có thể truy cập VPN công ty
    - Cài đặt một trình quản lý cơ sở dữ liệu. Ví dụ:
    + Mac và Windows: Sequel Pro, ...
    + Linux: Dbeaver, …
    - Workflow:
    Port forwarding từ local <-> bastion host <-> RDS in AWS
    + Để hiểu thì xem tutorial này: link

    View Slide

  3. Port forwarding
    ssh -i ~/.ssh/bastion_key.pem -NfC -L 7011:rds-name.cluster-xxx.region.rds.amazonaws.com:3306 ec2-user@IP-bastion-server

    View Slide

  4. Truy cập database với terminal
    mysql -h 127.0.0.1 -u db-user -D db-name -P 7011 -p

    View Slide

  5. Tạo một kết nối trong
    trình quản lý DB
    Chú ý:
    - server host: ?
    - port: ?
    - User/password: ?

    View Slide