Skip to content

Instantly share code, notes, and snippets.

@daleysoftware
Last active October 28, 2015 03:35
Show Gist options
  • Save daleysoftware/82d9b4dbe126c68c2861 to your computer and use it in GitHub Desktop.
Save daleysoftware/82d9b4dbe126c68c2861 to your computer and use it in GitHub Desktop.
Set the AeroFS MySQL database password
#!bin/bash
set -eu
# Revoke old open grants, add new password protected local-only grants.
mysql --user=root << EOF
revoke all privileges on \`polaris\`.* from 'aerofsdb'@'%';
revoke all privileges on \`bifrost\`.* from 'aerofsdb'@'%';
revoke all privileges on \`aerofs_sp\`.* from 'aerofsdb'@'%';
revoke all privileges on \`aerofs_ca\`.* from 'aerofsdb'@'%';
grant all privileges on \`polaris\`.* to 'aerofsdb'@'localhost' identified by 'your-db-password-here';
grant all privileges on \`bifrost\`.* to 'aerofsdb'@'localhost' identified by 'your-db-password-here';
grant all privileges on \`aerofs_sp\`.* to 'aerofsdb'@'localhost' identified by 'your-db-password-here';
grant all privileges on \`aerofs_ca\`.* to 'aerofsdb'@'localhost' identified by 'your-db-password-here';
set password for root@'localhost' = password('your-root-password-here');
EOF
# Add AeroFS configuration (must use same password as above).
echo 'mysql_password=your-db-password-here' >> /opt/config/properties/external.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment