From man mysql
:
If you use the short option form (-p), you cannot have a space between the option and the password.
So either
mysql -u root -p"$PASSWORD"
or
mysql -u root --password "$PASSWORD"
0
solved MySQL treats password in script as database