forked from tmont/node-sql-generate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovision.sh
More file actions
24 lines (17 loc) · 723 Bytes
/
provision.sh
File metadata and controls
24 lines (17 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y mysql-server postgresql libpq-dev
# create mysql user
mysql -u root
# create mysql user
mysql -u root < /vagrant/scripts/create_mysql_user.sql
# create postgres user
sudo su -c "psql -d postgres -f /vagrant/scripts/create_postgres_user.sql" postgres
# Allow remote connections to MySQL
sudo sed -i 's/^bind-address/#bind-address/' /etc/mysql/my.cnf
sudo restart mysql
# Allow remote connections to Postgres
sudo sed -i "s/^#listen_addresses = 'localhost'/listen_addresses = '\\*'/" /etc/postgresql/9.1/main/postgresql.conf
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.1/main/pg_hba.conf
sudo /etc/init.d/postgresql restart