- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to run SQL script in MySQL?
To run SQL script in MySQL, use the MySQL workbench. First, you need to open MySQL workbench.
The snapshot is as follows −
Now, File -> Open SQL Script to open the SQL script.
Alternatively, use the following shortcut key −
Ctrl+Shift+O
After that an option would be visible for you to choose your .sql file from the disk. In my system, the file is located on the Desktop. I will select the same “tblstudent” SQL file as shown in the following screenshot −
After browsing .sql files, you need to select the option “Reconnect to database” as shown in the following screenshot −
Now, it will ask for password to connect with MySQL. Add the password and click “OK” as in the following screenshot −
Note − Press OK button twice to connect with MySQL.
After completing the above process, the following screen will be visible with our SQL file “tblstudent”, which we uploaded before −
After that you need to execute the script. To execute the script, click the symbol marked in the following screenshot −
After that you will get the following output −