fgrehm/ventriloquist

View on GitHub
services/mysql/5.5/config/bin/add-mysql-user

Summary

Maintainability
Test Coverage
#!/bin/bash

set -e

user='vagrant'
password='vagrant'

mysqld& sleep 3

mysqladmin -u root password $password

echo "create user '${user}'@'%' identified by '${password}'" | mysql -u root -p$password
echo "grant all on *.* to '${user}'@'%' with grant option" | mysql -u root -p$password
echo "FLUSH PRIVILEGES;" | mysql -uroot -p${password}