Skip to content

Instantly share code, notes, and snippets.

@dstroot
Created May 23, 2012 16:55
Show Gist options
  • Save dstroot/2776351 to your computer and use it in GitHub Desktop.
Save dstroot/2776351 to your computer and use it in GitHub Desktop.
Install mysql on amazon EC2 AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/5fc6f3a63450ff6986ac916fce54d70c16937646/ec2-mysql-installation.sh
# chmod 777 install-redis.sh# ./install-redis.sh
###############################################
echo "*****************************************"
echo " Installing MySQL"
echo "*****************************************"
echo " "
sudo yum -y install mysql mysql-server
sudo /sbin/chkconfig --levels 235 mysqld on
sudo /sbin/service mysqld start
#sudo /etc/init.d/mysqld start
echo "*****************************************"
echo " Answer the wizard questions as follows:"
echo " 1: Enter current password for root: Press return for none"
echo " 2: Change Root Password: Y"
echo " 3: New Password: Enter *your* new password"
echo " 4: Remove anonymous user: Y"
echo " 5: Disallow root login remotely: Y"
echo " 6: Remove test database and access to it: Y"
echo " 7: Reload privilege tables now: Y"
echo "*****************************************"
read -p "Press [Enter] to continue..."
mysql_secure_installation
echo "Complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment