($(MYSQL_CMD)$(MYSQL_CONNECTION)-e"SELECT COUNT(*) FROM mysql.user WHERE user='$(DATABASE_USER)' AND host=\"$$host\";" | grep 0 )||(echo"The user '$(DATABASE_USER)@$$host' is already in the database. Please use another user or delete her. E.g. with 'mysql -u $(MYSQL_USER) -p -e \"DROP USER $(DATABASE_USER)@$$host;\"'";exit 1 );\
done
@while true;do\
@while true;do\
printf"\n Please enter the password for $(DATABASE_USER): ";read-s password;\
printf"\n Please enter the password for $(DATABASE_USER): ";read-s password;\
printf"\nPlease repeat the password for $(DATABASE_USER): ";read-s password2;\
printf"\nPlease repeat the password for $(DATABASE_USER): ";read-s password2;\
...
@@ -59,7 +62,7 @@ _grant:
...
@@ -59,7 +62,7 @@ _grant:
done;\
done;\
echo"";\
echo"";\
for host in$(subst $(comma), ,$(DATABASE_USER_HOST_LIST));do\
for host in$(subst $(comma), ,$(DATABASE_USER_HOST_LIST));do\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"CREATE USER '$(DATABASE_USER)'@'$$host' identified by '$$password';";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"CREATE USER IF NOT EXISTS '$(DATABASE_USER)'@'$$host' identified by '$$password';";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT USAGE ON *.* TO '$(DATABASE_USER)'@'$$host';";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT USAGE ON *.* TO '$(DATABASE_USER)'@'$$host';";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT ALL PRIVILEGES ON *.* TO '$(DATABASE_USER)'@'$$host' WITH GRANT OPTION;";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT ALL PRIVILEGES ON *.* TO '$(DATABASE_USER)'@'$$host' WITH GRANT OPTION;";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT EXECUTE ON *.* TO '$(DATABASE_USER)'@'$$host';";\
$(MYSQL_CMD)$(MYSQL_CONNECTION)-e"GRANT EXECUTE ON *.* TO '$(DATABASE_USER)'@'$$host';";\