I have a directory with daily backups of my entire MySQL database.
I want to import the most recent backup into the database.
I know to import a backup I need to use
mysql -u root -ppasswordhere < backup.sql
I've managed to get the most recent file with
ls -Art | grep '.sql' | tail -n 1, but I don't really know how to pipe the output to the command
mysql -u root -ppasswordhere
I am sure the answer is really obvious, I'm just confused.