You've already forked bash-helper
logic changes
This commit is contained in:
4
helper
4
helper
@@ -237,7 +237,7 @@ git_clone_if_missing() {
|
||||
}
|
||||
|
||||
#
|
||||
# Creates a MariaDB database and user
|
||||
# Creates a MariaDB database and user for both localhost and 127.0.0.1
|
||||
#
|
||||
setup_mariadb() {
|
||||
local mariapwd="$1" dbname="$2" dbuser="$3" dbpass="$4"
|
||||
@@ -260,7 +260,9 @@ EOF
|
||||
mysql --defaults-extra-file="$tmpfile" <<EOF
|
||||
CREATE DATABASE IF NOT EXISTS \`$dbname\`;
|
||||
CREATE USER IF NOT EXISTS '$dbuser'@'localhost' IDENTIFIED BY '$dbpass';
|
||||
CREATE USER IF NOT EXISTS '$dbuser'@'127.0.0.1' IDENTIFIED BY '$dbpass';
|
||||
GRANT ALL PRIVILEGES ON \`$dbname\`.* TO '$dbuser'@'localhost';
|
||||
GRANT ALL PRIVILEGES ON \`$dbname\`.* TO '$dbuser'@'127.0.0.1';
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
|
||||
|
Reference in New Issue
Block a user