navigation

How to Open an Sql File

Method 1 of 2:

Using MySQL Workbench

  1. Open the MySQL Workbench app on your computer. The MySQL Workbench icon looks like a dolphin in a blue square. You can find it on your Start menu on Windows or in the Applications folder on Mac.
    1. If you don't have MySQL Workbench installed on your computer, you can select your system, and download the app installer at https://dev.mysql.com/downloads/workbench.
  2. Double-click a model or database under "MySQL Connections." You'll find your available model instances here. Just double-click the one you want to use.
  3. Click the File tab on the top-left. This button is in the upper-left corner of your screen. It will open a drop-down menu.
  4. Click Open SQL Script on the File menu. This will open a new file navigator window, and allow you to select the SQL file you want to open.
    1. Alternatively, press Ctrl+ Shift+O (Windows) or Cmd+ Shift+O (Mac) on your keyboard.
  5. Find and click the SQL file you want to open. Use the file navigator window to find your SQL file, and click on its name to select the file.
  6. Click Open on the bottom-right. This button is in the lower-right corner of the file navigator pop-up. It will open your SQL file's contents in the MySQL Workbench app.
    1. You can view and edit your SQL script here.
Method 2 of 2:

Using a Text Editor

  1. Find and right-click the SQL file. This will open your right-click options on a drop-down menu.
  2. Hover over Open with on the right-click menu. This will open a list of recommended applications to open this file.
  3. Select Notepad (Windows) or TextEdit (Mac). This will open your SQL file in your text editor. You can easily view and manually edit the SQL script in the text editor here.
    1. If you don't see Notepad or TextEdit here, click Choose another app or Other at the bottom. This will open a list of all your applications.
Update 05 March 2020