- Login to MySQL server typing the following command
mysql -u username -p
It will prompt for password. Type your password and then it will take to mysql prompt (mysql>).
- Create a text file with your SQL queries (let's call it 1.sql)
- On mysql> prompt, type command source /path/to/1.sql
where /path/to - is the actual path of the file 1.sql on your system. For example,
mysql> source /home/praveen/Documents/programming/mysql/1.sql