stockholm/lass/5pkgs/mk_sql_pair/default.nix

20 lines
310 B
Nix
Raw Normal View History

2016-04-13 14:37:26 +00:00
{ pkgs, ... }:
pkgs.writeScriptBin "mk_sql_pair" ''
#!/bin/sh
name=$1
password=$2
if [ $# -ne 2 ]; then
echo '$1=name, $2=password'
exit 23;
fi
cat <<EOF
create database $name;
create user $name;
grant all on $name.* to $name@'localhost' identified by '$password';
EOF
''