Ok, throwing this out in the hopes of some guidance..

Trying to use SSH to pass MySql arguments to a server remotely.. almost all arguments work with exception to "create user"

This works on the server:

create user 'testing'@'localhost' identified by '123';

This doesn't work:

ssh root@[ip address] 'mysql --user="root" --password="[pass]" --execute="create user 'testing'@'localhost' identified by '123';"'

I've tried escaping the single quotes like this:

ssh root@[ip address] 'mysql --user="root" --password="[pass]" --execute="CREATE USER 'foo2'@'localhost' IDENTIFIED BY 'mariadb';"'

Show thread

That failed, so tried escaping the double quotes too:

ssh root@[ip address] 'mysql --user="root" --password="[pass]" --execute=& USER 'foo2'@'localhost' IDENTIFIED BY 'mariadb';&#34'

This actually gets past the error, but doesn't create the user on the remote server..

:(

Help..

Show thread
Sign in to participate in the conversation
Noc.Social

Open Source Social Network. Focused on technology, networking, linux, privacy and security, but open to anyone. Civil discourse, polite and open. Managed by the noc.org team.