---
title: "Automaticlly install mysql ree rails on Amazon EC2 Amazon Linux"
author: "xinlanzero"
date: "2011-07-20T15:00:56Z"
tags: []
categories: ["互联网"]
slug: "automaticlly-install-mysql-ree-rails-on-amazon-ec2-amazon-linux"
draft: false
lastmod: "2011-07-20T15:00:56Z"
id: 1128848
url: "https://xinlanzero.iteye.com/blog/1128848"
---

yum remove -y ruby

yum install -y gcc make patch zlib-devel  openssl-devel  c++  gcc  gcc-c++   gcc-c++  readline-devel curl-devel mysql mysql-server curl mysql-devel

mkdir ~/src

cd ~/src

wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz

tar xzvf ruby-enterprise-1.8.7-2011.03.tar.gz

./ruby-enterprise-1.8.7-2011.03/install

ln -s /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby /usr/bin/ruby

ln -s /opt/ruby-enterprise-1.8.7-2011.03/bin/gem /usr/bin/gem

ln -s /opt/ruby-enterprise-1.8.7-2011.03/bin/rake /usr/bin/rake

ln -s /opt/ruby-enterprise-1.8.7-2011.03/bin/bundle /usr/bin/bundle

sudo service mysqld start

/usr/bin/mysqladmin -u root password 'new-password'