dotfiles/bin/mysql_add_user.sh

13 lines
341 B
Bash
Raw Normal View History

2018-04-05 20:14:03 +00:00
#! /bin/bash
newUser='klaviyo'
newDbPassword='oyivalk'
newDb='test_klaviyo'
host=localhost
#host='%'
commands="CREATE DATABASE \`${newDb}\`;GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "${commands}" | mysql -u root