How to execute a .sql script from bash March 4, 2023 by Tarik You simply need to start mysql and feed it with the content of db.sql: mysql -u user -p < db.sql