简体   繁体   English

从Amazon EC2实例连接到Windows 7上的mysql

[英]connect to mysql on Windows 7 from Amazon EC2 Instance

I have installed "Mysql Workbench 6.3 CE" on my windows 7 laptop, I have my Hadoop 3 node cluster setup on Amazon EC2 Instance. 我在Windows 7笔记本电脑上安装了“ Mysql Workbench 6.3 CE”,并且在Amazon EC2实例上设置了Hadoop 3节点群集。 Now I want to import data from Mysql which is installed on my windows 7 laptop to my Hadoop Instance on Amazon EC2. 现在,我想将数据从Windows 7便携式计算机上安装的Mysql导入到Amazon EC2上的Hadoop实例。

I have gone through this article: Connect to remote mysql via terminal 我看过这篇文章: 通过终端连接到远程mysql

the above article says : Try to comment the bind-address = 127.0.0.1 in your /etc/mysql/my.cnf 上面的文章说: Try to comment the bind-address = 127.0.0.1 in your /etc/mysql/my.cnf

since Mysql is installed on windows machine I don't find the file /etc/mysql/my.cnf on my Amazon Instance. 由于Mysql已安装在Windows计算机上,因此在我的Amazon Instance上找不到文件/etc/mysql/my.cnf

on my windows 7 machine i tried to look at C:\\Program Files\\MySQL\\MySQL Server 5.7/my.ini but i dont see any line that says "bind-address" 在我的Windows 7计算机上,我尝试查看C:\\Program Files\\MySQL\\MySQL Server 5.7/my.ini但我没有看到任何显示“ bind-address”的行

any help on my above query would be of great help since I was trying this long time by going through different articles of yours and other web sites. 由于我长时间浏览了您的文章和其他网站上的不同文章,因此对上述查询的任何帮助都将带来极大的帮助。

Amazon EC2 Instance Amazon EC2 Instance connected - Mysql on Windows 7 Machine Amazon EC2实例已 连接Amazon EC2实例-Windows 7计算机上的Mysql

So the setup is something like this : 所以设置是这样的:

# Local notebook : Mysql server +  Mysql workbench 
# AWS : EC2 Hadoop instance

And you want to EXPORT data from your local notebook to EC2 Hadoop? 您想将本地笔记本中的数据导出到EC2 Hadoop吗?

I assume you want to do this (replace the indicator name with your own) 我假设您想这样做(用您自己的指标名称代替)

# 1. export your database table to a file  
#  execute "mysqldump -u your_db_username -p your_dbname > dbname.sql" 

# 2. copy the file to ec2 hadoop instance 
# ssh copy to remote host "scp dbname.sql  ubuntu@your_hadoop_ip -i your_hapoop_pem_key"

# 3. ssh to your_hadoop_ip and do the import. 

If you intend to connect FROM AWS EC2 to your LOCAL laptop, that is another story. 如果您打算从AWS EC2连接到LOCAL便携式计算机,那就是另一回事了。

Short answer : Not your way. 简短的回答:不是你的方式。 If you just want to put data to hadoop, use above export and import step. 如果只想将数据放入Hadoop,请使用上面的导出和导入步骤。

Longer answer : you can create a temporary SSH reverse tunnel to allow the cloud EC2 server connect to your local notebook. 更长的答案:您可以创建一个临时的SSH反向隧道,以允许云EC2服务器连接到本地笔记本。 It is tedious and you need good network knowledge to fix it if it doesn't work. 这很繁琐,如果不起作用,您需要良好的网络知识来修复它。

Here is an example : reverse ssh tunneling . 这是一个示例: 反向ssh隧道 This is not as easy because you need to know i. 这不是那么容易,因为您需要了解我。 you notebook public IP address ii. 您的笔记本电脑的公共IP地址ii。 Allow inbound for that inbound port inside VPC security group ,etc. 允许VPC安全组等中的入站端口入站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM