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 ?