Rails: Getting MySQL, PostgreSQL or SQLite installed on Ubuntu

I don’t how many times I had to google this so here it for posterity:

Install the sqlite3 connector:
sudo apt-get install libsqlite3-dev
sudo gem install sqlite3-ruby

Or install the MySQL database and it’s connector:
sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev
sudo gem install mysql

install the PostgreSQL database and it’s connector:
sudo apt-get install postgresql-server postgresql-client
sudo apt-get install libpq-dev
sudo gem install pg

PostgreSQL: Installing on windows using alternate service username

I came across this scenario the other day. I had to install PostgreSQL 9.0 on a windows box that already had an old PostgreSQL install and hence a local postgres account already setup. Using the same postgres account was not an option as a) I didn’t know the password and b) if the the password ever changed nobody would update the PostgreSQL 9.0 service entry with the updated password.

Fortunately there is an easy way to do this. Launch the one-click installer from the command line with the following arguments

postgresql-9.0.01-1-windows.exe --serviceaccount username

This will allow you to complete the installation as usual but the service account username will be the value passed. You can confirm this on the screen which asks you for the password. You can also complete the whole installation unattended just Launch the one-click installer with –help argument for a full list of options.