MySQL выберите снаружи
mysql -h host -u root -proot -e "show databases;";
Lucky Ladybird
mysql -h host -u root -proot -e "show databases;";