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

20 lines
304 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
2016-04-27 10:52:16 +00:00
create database $name;
create user $name;
grant all on $name.* to $name@'localhost' identified by '$password';
2016-04-13 14:37:26 +00:00
EOF
''