AWS RDS:使用Navicat连接

编程入门 行业动态 更新时间:2024-10-24 04:41:02
本文介绍了AWS RDS:使用Navicat连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚在弗吉尼亚州北部创建了RDS实例.尝试使用Navicat连接该数据库.

I have just created RDS Instance in N.Virginia & trying to connect that database using Navicat.

但是我无法连接它.

通过Internet搜索之后,我知道我们需要配置安全组.但就我而言,有一个通知:

After searching over internet I came to know that we need to configure Security Groups. But in my case there is a notification :

Your account does not support the EC2-Classic Platform in this region. DB Security Groups are only needed when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your DB Instances. Go to the EC2 Console to view and manage your VPC Security Groups. For more information, see AWS Documentation on Supported Platforms and Using RDS in VPC.

请帮助我解决此问题. N.Virginia也是AWS自动分配的.最好选择Free.N.Viginia.

Please help me out to resolve the issue. And also N.Virginia is what the AWS assigned automatically. It is good to opt for N.Viginia in Free-tier.

推荐答案

我可能不建议从本地系统直接获得RDS数据库上的链接.我可能会建议只能登录ec2实例,但让我们看看

I would probably not advised to get a direct link on your RDS Database from your local system; I would probably recommend to be able to only log in form ec2 instance, but lets look

在RDS中创建数据库(将为Oracle,mysql ...)时,您定义了访问方式/人员.

When you create your Database in RDS (will be Oracle, mysql ...) you defined how/who will access it.

  • 使您的实例可公开访问
  • 如果要使EC2实例和托管数据库实例的VPC外部的设备连接到数据库实例,请选择是".如果您选择否,则Amazon RDS不会为数据库实例分配公共IP地址,并且VPC之外的任何EC2实例或设备都将无法连接.如果选择是",则还必须选择一个或多个VPC安全组,这些安全组指定哪些EC2实例和设备可以连接到数据库实例.

    Select Yes if you want EC2 instances and devices outside of the VPC hosting the DB instance to connect to the DB instance. If you select No, Amazon RDS will not assign a public IP address to the DB instance, and no EC2 instance or devices outside of the VPC will be able to connect. If you select Yes, you must also select one or more VPC security groups that specify which EC2 instances and devices can connect to the DB instance.

    如果您说yes,则可以从本地笔记本电脑连接到数据库.如果您说no很好,则只有在同一VPC中启动的ec2实例才能访问它.

    If you say yes you will be able to connect to your database from your local laptop. If you say no well only ec2 instance launched from within the same VPC will be able to access it.

  • 定义您的VPC安全组
  • 如果选择现有的VPC,则可能有一些已定义的安全组.如果您没有VPC或没有现有的安全组. 安全组可以被看作就像防火墙一样,定义了打开的端口以及可以访问的端口.

    If you select an existing VPC, you probably have some defined security groups. In case you dont have VPC or no existing security groups. The Security groups can be viewed as acting like a firewall, you defined which port are opened and who can access.

    如果您离开创建新的安全组,则数据库将启动,并且将创建一个新的安全组.您可以从AWS控制台进行检查(确保选择创建数据库的区域)或直接 console.aws.amazon/vpc/home?region=us-east-1#securityGroups :(请替换该区域,以防您使用其他东西).创建的新安全组将命名为rds-launch-wizard

    If you leave Create new Security Group the DB will launch and a new Security Group will have been created. You can review from the AWS Console (make sure to select the same region where you created your DB) or directly console.aws.amazon/vpc/home?region=us-east-1#securityGroups: (replace the region in case you use something else). The new Security Group created will be named rds-launch-wizard

    编辑安全组并查看入站规则,默认情况下,AWS将创建一个新规则来打开您IP的端口(取决于数据库),您可以将其更改为打开更多IP或进一步限制.

    Edit the Security Group and review the inbound rules, by default AWS will have created a new rule to open the port (depending the DB) to your IP, you can change that to open to more IP or restrict further.

    安全规则是为RDS支持的数据库(Oracle,MS SQL和MySQL/Aurora)预先定义的,因此,当您添加新的入站规则时,只需从列表中选择合适的项即可.

    Security Rules are predefined for the RDS supported database (Oracle, MS SQL and MySQL/Aurora) so just select the right item from the list when you add a new inbound rule

    数据库实例启动后,您可以查看端点

    When the DB instance has launched you can review the endpoint

    因此您可以从本地笔记本电脑进行连接

    and so you are able to connect from your local laptop

    $ mysql -u <username> -p -h <database>rsdab7emat.us-east-1.rds.amazonaws Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 5.6.10 MySQL Community Server (GPL) Copyright (c) 2000, 2014, 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> status -------------- mysql Ver 14.14 Distrib 5.6.22, for osx10.10 (x86_64) using EditLine wrapper Connection id: 21 Current database: Current user: <username>@90.27.155.48 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.6.10 MySQL Community Server (GPL) Protocol version: 10 Connection: <database>rsdab7emat.us-east-1.rds.amazonaws via TCP/IP Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 TCP port: 3306 Uptime: 6 min 33 sec Threads: 5 Questions: 2656 Slow queries: 0 Opens: 89 Flush tables: 1 Open tables: 82 Queries per second avg: 6.758 -------------- mysql>

    如果您希望使用Navicat进行连接,则应该能够进行设置以建立相同的连接.

    If you prefer to connect using Navicat, you should be able to set the settings to establish the same connection.

    更多推荐

    AWS RDS:使用Navicat连接

    本文发布于:2023-11-16 04:37:23,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1601050.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:AWS   RDS   Navicat

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!