close ad
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

Import a .sql file

Tutorial created by Ray Borduin, WebAssist

Categories: eCart, MySQL


This tutorial guides you through importing a MySQL script into MySQL Query Browser and phpMyAdmin. A .SQL script file is provided in a number of WebAssist products to give you the necessary database tables and structure without you needing to do any of the work.
Steps are provided for two of the most common MySQL database management applications. If you do not know which tool you should use, check to see if your Hosting Provider provides a phpMyAdmin control panel with your hosting package. In most cases, this should provide all the functionality you will need.

Note: As listed below in the Getting started section, an empty MySQL database is recommended. However, as long as your database does not contain any of the tables that are to be created by the .SQL script, everything should import fine.

arrow downGetting started

To get started, you will need:

  1. A .sql script file containing a CREATE TABLE command
  2. MySQL Query Browser or phpMyAdmin
    Other MySQL database tools will require similar steps.
  3. An empty MySQL database already created
Most .sql script files provided through require MySQL server 4.2 or higher for it to be successfully imported. Any previous version may return an error. If you receive an error when importing to your live server, you may want to contact your hosting provider to confirm the version that is being used.

arrow downUsing phpMyAdmin

phpMyAdmin is commonly used for managing MySQL databases. Many hosting providers, such as GoDaddy, provide this tool for making database modifications. Although various hosting providers use different versions of phpMyAdmin, the steps shown here should be consistent throughout.

Step 1: Copy the SQL script

  1. On your computer, navigate to the .sql file you intend to import to
  2. your database.
  3. Open the .sql file in a regular text editor such as Notepad or TextEdit.
  4. Select all the content by pressing Ctrl (Cmd) A.
  5. Copy the content by pressing Ctrl (Cmd) C.
  6. Close your text editor application.

Step 2: Execute the SQL script

  1. In phpMyAdmin, choose the database you intend to work with from the Database menu list.
  2. Choose the SQL tab.
  3. Paste the SQL script you copied by pressing Ctrl (Cmd) V
  4. Choose Go.
  5. Confirm that your new table has been imported by clicking the Structure tab.

arrow downUsing MySQL Query Browser

MySQL Query Browser is part of the MySQL GUI Tools available at These same steps can be used for most other MySQL administrator tools.

  1. Using the MySQL Query Browser, connect to your MySQL Server.
  2. From the Schemata panel, select the database you intend to add the new database table to.
  3. Choose File > Open Script.
  4. Navigate to the .sql file you wish to import.
  5. Click Open.
  6. Select Execute.
  7. Confirm that the new database table appears in the Schemata panel.

arrow downReviews and comments

Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.

Sign in to add comments

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.