Help us understand the problem. What is going on with this article?

DBeaverでSSHポートフォワーディングしてAWS EC2のMySQLに接続

概要

SSIA

環境

  • 開発端末
    • Mac
  • サーバ
    • AWS Linux 2
    • MySQL 8.0.15

目的

  • AWSにDBを置いて3306で通信すると、暗号化されてないので危険
  • そこで暗号化ですよ
  • そこでSSHポートフォワーディングですよ
    • SSHトンネリングと言った方が想像しやすいが、googleabilityはポートフォワーディングの方が上

手順

  • AWS EC2にMySQLをインストール
  • インスタンスにSSH接続 ssh -i "mylara-db.pem" ec2-user@50.198.199.200
  • mysqlコマンド実行してから
CREATE DATABASE IF NOT EXISTS `mylaradb` COLLATE 'utf8_general_ci';
CREATE USER 'mylara'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Mylara-Password1234';
GRANT ALL ON `mylaradb`.* TO `mylara`@`localhost`;

※ mysql_native_passwordは本題と関係ないです

  • 開発端末にDBeaverをインストール
  • 接続設定

スクリーンショット 2019-03-27 2.04.40.png
スクリーンショット 2019-03-27 2.05.50.png

結果

接続成功

スクリーンショット 2019-03-27 2.19.36.png

Hope this helps.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした