Importing the Northwind Access Database into MySQL

Description

A step-by-step tutorial for importing the Northwind Access Database into MySQL.

Discussion

The Northwind database is a Microsoft Access database that ships with Alpha Anywhere. In order to perform CRUD (Create, Read, Update, Delete) operations on the Northwind Access database, the database must be copied to a directory where you have read/write access or converted to another database format. The Northwind Access database can be found inside the MDBFiles directory in your Alpha Anywhere installation. Your Alpha Anywhere install is typically located at C:\Program Files (x86)\a5v12. In this tutorial, you will learn how to convert the Northwind Access database to a MySQL database.

This tutorial demonstrates importing the Northwind database into MySQL Server using MySQL Workbench 6.3 CE.
  1. Download the northwindmysql.zip file and extract its contents somewhere on your computer. The .zip contains the Northwind Access database in a self-contained SQL file named "northwindmysql.sql".

    images/northwindMySQL1.png
  2. Open MySQL Workbench. Under Management, open the Data Import/Restore tool.

    images/northwindMySQL2.png
  3. On the Import from Disk tab, select Import from Self-Contained File. Use the browse button to select the northwindmysql.sql file you extracted from the download in the first step.

    images/northwindMySQL3.png
  4. Select the Default Target Schema:. The northwindmysql.sql file does not have a target schema. Use the New button to create a new target schema named "northwind".

    images/northwindMySQL4.png
  5. Click the Start Import button to import the Northwind database into the selected target schema. The Import Progress tab will display the progress of the import.

    images/northwindMySQL5.png
  6. You should now see a list of tables in the northwind schema. The Northwind database is now imported into MySQL.

    images/northwindMySQL6.png

Build a MySQL Connection String

Now that the Northwind database has been imported into MySQL, the next step is to create a Connection String to the database.

  1. From the Web Projects Control Panel, select [ManageConnStr] Manage Connection Strings > Alpha DAO Connection strings from the Edit menu to create a new connection string.

    images/connectionstring1.png
    Open the AlphaDAO Connections dialog.
    images/connectionstring2.png
    The AlphaDAO Connections Dialog.
  2. Click the New button to create a new connection string. Type in "Northwind" for the Connection Name and click the Build button to construct the Connection String.

    images/connectionstring3.png
    Creating a new connection to the Northwind MySQL database.
  3. Select MySQL from the list of options in the Select an API window and click OK.

    images/connectionstringMySQL1.png
    Set the Connection Type to MySQL.
  4. Configure the MySQL Options for the connection. Choose the Version of MySQL that is installed.

    images/connectionstringMySQL7.png
  5. Enter "localhost" in Hostname. If the MySQL database is hosted on another computer, enter the host IP address. For example, 127.0.0.1.

  6. Enter the MySQL Port number. The default port number for a typical MySQL installation is "3306".

  7. Enter the User for accessing the MySQL database. On your development machine, this can be "root" or a user account you created.

  8. Enter the password for the User account specified.

  9. Verify the connection to MySQL is correct by clicking the Test Connection button. You should see a success message. If you receive an error message, verify the Hostname, Port, User, and Password are correct.

    images/connectionstringMySQL3.png
    Success! The connection string to the MySQL database works.
  10. Select the MySQL Northwind database you created from the Database list. If Database does not have any options, click the Refresh button. If it still does not list any databases, verify the User you have chosen has access to the MySQL Northwind database.

    images/connectionstringMySQL2.png
    Configuring the MySQL connection string. The Northwind database in this MySQL instance is named "northwind".
  11. Click OK to create the MySQL connection string.

    images/connectionstringMySQL4.png
    Click OK to save the MySQL Connection string.
  12. Click OK to save the new Northwind connection string.

    images/connectionstringMySQL5.png
    Click OK to save the Northwind connection string.
  13. Click the Close button to exit the AlphaDAO Connections dialog. You can now build a mobile or web application that communicates with the Northwind MySQL database. Click here for a list of tutorials that use the Northwind database.

    images/connectionstringMySQL6.png
    The Northwind AlphaDAO connection string for MySQL

See Also