Modification : vm_hosted -> etc/sv/*/configure.sh .
[lhc/ateliers.git] / etc / mysql / bin / createuser
diff --git a/etc/mysql/bin/createuser b/etc/mysql/bin/createuser
new file mode 100755 (executable)
index 0000000..bf58fea
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -eux
+user="$1"
+sudo mysql -u mysql --batch <<-EOF || true
+       DROP   USER '$user'@'localhost';
+       EOF
+sudo mysql -u mysql --batch <<-EOF
+       CREATE USER '$user'@'localhost' IDENTIFIED WITH auth_socket;
+       EOF