Init commit

This commit is contained in:
Moris Zen
2018-06-24 12:01:25 +02:00
commit 720a1c31a4
12 changed files with 446 additions and 0 deletions

15
mysql_config.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
# If there's no password set for MySQL (first-time install), add one and cleanup
if mysql -uroot; then
mysql -uroot <<_EOF_
UPDATE mysql.user SET authentication_string=PASSWORD('root') WHERE User='root';
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DROP DATABASE IF EXISTS test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;
_EOF_
fi
fi