I was recently building a script to help move things from one server to another and in the process stumbled into a very annoying problem when passing MySQL arguments to a remote server via SSH.
Desired outcome: Create a new user in a remote DB using SSH.
In practice, this should be extremely simple. If you do this on the server, you could execute a command like this:
mysql --user="root" --password="[pass]" --execute="create user 'testing'@'localhost' identified by '123';"
You would now have a new user in your database called testing and it’s password would be 123.
Continue reading “ERROR 1064 (42000) at line 1 – Passing MySQL Create User Arguments via SSH”