ketr.photos/reset-db.sh
James Ketrenos a076bdf86c Fixed reset-db to use PASSWORD for pw if set
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
2018-08-22 14:27:49 -07:00

11 lines
269 B
Bash
Executable File

#!/bin/bash
U='photos'
P=${PASSWORD:p4$$w0rd}
D='photos'
mysql -u root --password=${P} << EOF
DROP DATABASE IF EXISTS ${D};
CREATE DATABASE ${D} CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON ${D}.* TO '${U}'@'localhost' IDENTIFIED BY '${P}';
EOF