连接到MySQL在AWS弹性魔豆 [英] Connecting to Mysql on AWS Elastic Beanstalk

查看:267
本文介绍了连接到MySQL在AWS弹性魔豆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是比较新的LAMP开发谁正在努力学习Linux主要通过AWS。我有启动和运行实时弹性魔豆实例。我做了百胜安装下面的包:

I am relatively new LAMP dev who is trying to learn Linux primarily through AWS. I have a live Elastic Beanstalk instance up and running. I did a yum install of the following packages:

mysql55.x86_64 mysql55-bench.x86_64 mysql55-common.x86_64 mysql55-devel.x86_64 mysql55-libs.x86_64 mysql55-server.x86_64 mysql55-test.x86_64 

这一切似乎安装罚款......然后键入...

Which all seemed to install fine ... then typed ...

mysql -V 

这让我

mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 

...这证实了安装mysql的......但后来当我输入...

... which confirms mysql is installed ... but then when I type ...

mysql -u ec2-user -p
Enter password: /*leaving blank*/

我得到...

I get ...

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

现在的事情是我的ssh-荷兰国际集团到这个服务器,我在AWS控制台创建了一个安全组密钥对。所以,当我登录到框,EC2,用户密钥认证我(从.ppk文件)。这就是我的根用户,据我所知,没有密码,但我可能是错了。

Now the thing is I am ssh-ing into this server with a Security Group key pair I created in AWS Console. So the key is authenticating me (from the .ppk file) when I log into the box as ec2-user. That IS my "root" user as far as I know, there is no password, but I may be mistaken.

所以,基本上我不明白的基本知识如何开始在Linux环境中使用MySQL。我只真正使用的phpMyAdmin和WAMP MySQL命令行到现在。

So, basically I don't understand the basics of how to begin using MySQL in a linux environment. I've only really used PHPMyAdmin and the MySQL command line from WAMP until now.

有人可以帮助我在那里我得到我这里的电线交叉?

Can somebody help me with where I'm getting my wires crossed here?

推荐答案

哇。耽误。在你做别的,停止并旋转起来青苗之外你的mysql的机器,或使用亚马逊RDS 。魔豆被设计为自动缩放应用程序的Web层,而不是持有你的数据库。目前它扩展你的应用,这台新机器不会有你的数据。它扩展背下来的那一刻,它可能会删除你的数据库的机器。如果这种实例结束了对退休或已损坏的硬件,青苗将予以更换。

Whoa. Hold up. Before you do anything else, stop and spin up your mysql machine outside of beanstalk, or use Amazon RDS. Beanstalk is designed to autoscale the web tier of your application, not hold your database. The moment it scales your application up, that new machine won't have your data. The moment it scales back down, it might remove your database machine. If that instance ends up on retired or corrupt hardware, beanstalk will replace it.

<一个href="http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/concepts.concepts.architecture.html">Give魔豆架构概述一读。注意图中。你的数据库层存在魔豆环境之外,没有在里面。

Give the Beanstalk architectural overview a read. Note the diagram. Your database layer exists outside the beanstalk environment, not in it.

这篇关于连接到MySQL在AWS弹性魔豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆