Skip to content

Instantly share code, notes, and snippets.

@jmervine
Created March 18, 2012 19:04
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jmervine/2079897 to your computer and use it in GitHub Desktop.
Save jmervine/2079897 to your computer and use it in GitHub Desktop.
installing mysql on ubuntu using an aws instance
$ sudo apt-get install mysql-server mysql-client
... output omitted ...
$ sudo mysqladmin -u root -h localhost password 'password'
... output omitted ...
$ mysql -u root -p
... output omitted ...
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'your_host_name' IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
$
# Enabling remote connections #
$ sudo vi /etc/mysql/my.cnf
Change:
bind-address = 127.0.0.1
To:
bind-address = <your ip address>
$ sudo /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
$ sudo iptables-save
$ sudo iptables-apply
$ sudo service mysql restart
#
# setting up client host for rails with bundler
#
$ sudo apt-get install mysql-client # if different host
$ sudo apt-get install libmysqlclient-dev
... ensure that mysql is specified in your Gemfile ...
$ bundle config build.mysql --with-mysql-config=/usr/bin/mysql_config
$ bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment