Ubuntu bash mysql script looks like that
mysql -h localhost -u $MYSQLLOGIN -p$MYSQLROOTPASS -t -e '
CREATE USER $USERNAME@'localhost' IDENTIFIED BY $MYSQLPASS;
create database $MYSQLDB;
grant usage on *.* to $USERNAME@localhost identified by $MYSQLPASS;
grant all privileges on $MYSQLDB.* to $USERNAME@localhost';
Getting error message
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$MYSQLPASS' at line 1
In fact $MYSQLPASS is variable with string content. And it's not empty, when I test. What am I doing wrong?