How to have simple and double quotes in a scripted ssh command

Viewed 877

I am writing a small bash script and want to execute the following command via ssh

sudo -i mysql -uroot -pPASSWORD --execute "select user, host, password_last_changed from mysql.user where password_last_changed <= '2016-9-00 11:00:00' order by password_last_changed ASC;"

Unfortunately this command contains both simple and double quotes so I can't do

ssh user@host "command";

What would be the recommended way to solve this issue ?

1 Answers
Related