MySQL treats password in script as database

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"

Leave a Comment