- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 −
- Related Articles
- How to run .SQL script using JDBC?
- Run SQL file in MySQL database from terminal?
- How to run a PowerShell script from the command prompt?
- How to echo print statements while executing an SQL script?
- Run a Script on Startup in Linux
- Performing Null check using HANA SQL Script
- SQL Script vs Graphical Calcualtion views in SAP HANA
- How to write a MySQL “LIMIT” in SQL Server?
- How to make SQL case sensitive string comparison in MySQL?
- Run Python script from Node.js using child process spawn() method?
- MySQL Extensions to Standard SQL
- Run a Function in a Script from the Command Line on Linux
- How can we run MySQL statements in batch mode?
- How do I pass a variable to a MySQL script?
- How to write PHP script to update an existing MySQL table?
