Commit 013123e9 authored by root's avatar root

Removed script.

parent 4d3865d4
#! /bin/bash
if [[ $# -eq 0 ]] ; then
echo 'Parameter missing...'
echo 'setup_maria_db.sh <user> <password> <db>'
exit 1
fi
newUser=$1
newDbPassword=$2
newDb=$3
host='%'
commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "${commands}" | mysql
host=localhost
commands="CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "${commands}" | mysql
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment