htsql / cogs.local / data / vm / mysql51-update.sh

Kirill Simonov d6c524c 































#/bin/sh

# Post-installation script for the mysql51 VM.
set -ex

# Update the hostname.
echo mysql51-vm >/etc/hostname

# Preset the password for the MySQL root user.
echo "mysql-server-5.1 mysql-server/root_password password admin" | debconf-set-selections
echo "mysql-server-5.1 mysql-server/root_password_again password admin" | debconf-set-selections

# Install MySQL 5.1.
apt-get -qy install mysql-server-5.1

# Clean APT cache.
apt-get clean

# Configure MySQL to listen on all interfaces.
cat <<END >/etc/mysql/conf.d/bind_address.cnf
[mysqld]
bind-address = 0.0.0.0
END

# Start the server (since it is not started during OS installation).
/etc/init.d/mysql start

# Grant administrative privileges to the root user regardless of the client
# hostname.
cat <<END | mysql -uroot -padmin
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;
END
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.