Skip to content

Instantly share code, notes, and snippets.

@elmijo
Last active March 9, 2017 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmijo/2adbafa2f8d8d36e8bc875768f8a34f2 to your computer and use it in GitHub Desktop.
Save elmijo/2adbafa2f8d8d36e8bc875768f8a34f2 to your computer and use it in GitHub Desktop.
#! /bin/bash
echo "configuring.."
sudo echo mysql-server mysql-server/root_password select 123456 | debconf-set-selections
sudo echo mysql-server mysql-server/root_password_again select 123456 | debconf-set-selections
echo "installing..."
sudo apt-get install postgresql postgresql-client pgadmin3 mysql-server mysql-client mysql-workbench -y
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres password '123456';"
sudo updatedb
sudo sed -i '85s/peer/md5/' $(locate --regexp=pg_hba.conf$ --limit=1)
sudo sed -i '90s/peer/md5/' $(locate --regexp=pg_hba.conf$ --limit=1)
sudo service postgresql restart
echo "finish!!"
@elmijo
Copy link
Author

elmijo commented Mar 9, 2017

This is the simple way to use

curl -sSo- https://gist.githubusercontent.com/ElMijo/2adbafa2f8d8d36e8bc875768f8a34f2/raw/26a5473976eca021e917fa3b6dcaaa438bca8804/ubuntu-install-database.sh | sudo sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment