If you are on MySQL command prompt and need to execute all SQL queries contained in SQL file. You can simply do this by using source option to load any .sql file on your MySQL database. This executes all SQL queries available in a text file on selected database. For example, you have a database schema file schema.sql to load on the database. Now login to MySQL server and select database. After that, run the following command from the MySQL command prompt. The above command will run all the available SQL queries on selected database (mydb in my case).