Help importing Northwind db to mysql

  • Thread starter Thread starter aheight
  • Start date Start date
  • Tags Tags
    Db Mysql
Click For Summary

Discussion Overview

The discussion revolves around the challenges of importing the Northwind database into MySQL, specifically using phpMyAdmin on a WAMP server setup. Participants explore various methods and solutions to address import errors related to SQL syntax differences.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant reports errors encountered while importing the Northwind database SQL file, specifically related to unexpected characters.
  • Another participant suggests that the "$" character may be causing issues, as it is a PHP metacharacter, and recommends escaping it before import.
  • A different participant mentions that the Northwind SQL file cannot be directly imported into MySQL and proposes using Microsoft Access to export the database via ODBC or finding a ready-to-go script.
  • One participant acknowledges the syntax differences between various database versions and suggests using mysqldump for conversion.
  • Another participant clarifies that the GitHub version of Northwind does not require Access and points out that there are already converted MySQL files available.
  • A participant expresses difficulty navigating GitHub and understanding the import process, realizing they need to create the database first before importing data.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of Microsoft Access for importing the Northwind database, with some asserting it is required while others claim that converted MySQL files are available. The discussion remains unresolved regarding the best method for importing the database.

Contextual Notes

Participants note that different databases and versions may use varying syntaxes, which can lead to import issues. There is also mention of potential confusion regarding the correct sequence of database creation and data import.

aheight
Messages
318
Reaction score
108
Hi,

I am having problems importing the Northwind database https://msdn.microsoft.com/en-us/library/bb399411(v=vs.110).aspx into mysql on my machine. I'm running wamp64 and mysgl ver 5.7.14. When I download the files, I obtain instnwnd.sql file. However, when I use phpMyAdmin and attempt to import the file, I receive a bunch of error messages. Here are a few of them:

78 errors were found during analysis.
  1. Unexpected character. (near "$" at position 108292)
  2. Unexpected character. (near "$" at position 108300)
  3. Unexpected character. (near "$" at position 108524)
  4. Unexpected character. (near "$" at position 108532)
  5. Unexpected character. (near "$" at position 108768)
  6. Unexpected character. (near "$" at position 108775)
  7. Unexpected character. (near "$" at position 109057)
  8. Unexpected character. (near "$" at position 109065)
I was wondering if someone could help me install this database onto my machine?

Thanks
 
Technology news on Phys.org
Have you googled the error? I'm sure someone has run into this.

Perhaps the $ is the problem. Isn't that a PHP metacharacter to identify a variable to be substituted in?

The directions say you should use the nwind.exe command to install the database so perhaps you can't do it via PHP admin tools.

If it is the $ character then you will need to escape it in your file before importing it.
 
  • Like
Likes   Reactions: aheight
aheight said:
Hi,

I am having problems importing the Northwind database https://msdn.microsoft.com/en-us/library/bb399411(v=vs.110).aspx into mysql on my machine. I'm running wamp64 and mysgl ver 5.7.14. When I download the files, I obtain instnwnd.sql file. However, when I use phpMyAdmin and attempt to import the file, I receive a bunch of error messages. Here are a few of them:

78 errors were found during analysis.
  1. Unexpected character. (near "$" at position 108292)
  2. Unexpected character. (near "$" at position 108300)
  3. Unexpected character. (near "$" at position 108524)
  4. Unexpected character. (near "$" at position 108532)
  5. Unexpected character. (near "$" at position 108768)
  6. Unexpected character. (near "$" at position 108775)
  7. Unexpected character. (near "$" at position 109057)
  8. Unexpected character. (near "$" at position 109065)
I was wondering if someone could help me install this database onto my machine?

Thanks

As jedishrfu points out, you cannot just import the sql file for Northwind, as it is, in MySQL. I'll give you two alternative ways, without use of the sql file you mention.

If you have Microsoft Access on your machine, you can export Northwind database to MySQL, via ODBC. It is fairly simple to do it yourself. Alternatively, there is a ready-to-go script to do it. I leave it to you to find these by googling.

If you don't have Microsoft Access, then take a look at this GitHub page. It has a MySQL version of Northwind demo database.
 
  • Like
Likes   Reactions: aheight
Ok thanks guys. Didn't think to google the error but now after doing so I realize various databases and versions of the same database, use slightly different syntaxes which can cause problems with import. I don't have Access and looks like the GitHub version (in the instructions) requires Access as well. Also, after googling the error, I found out it's likely the Northwind is an older version of sql and the syntax has changed. One site suggest using mysqldump to convert the file. Will look into it more.
 
Last edited:
aheight said:
I don't have Access and looks like the GitHub version (in the instructions) requires Access as well.

It does not. Look at the README.md file and to the committed FILES. The northwind-data.sql and northwind.sql files are already converted to MySQL. You can also work with MySQL Workbench by the way, which is a really great tool. It is also a very good idea to learn working using GitHub - if you haven't already done so. But it is also very good for learning, if you try to convert the sql file you refer to in your OP.
 
  • Like
Likes   Reactions: aheight
QuantumQuest said:
It does not. Look at the README.md file and to the committed FILES. The northwind-data.sql and northwind.sql files are already converted to MySQL. You can also work with MySQL Workbench by the way, which is a really great tool. It is also a very good idea to learn working using GitHub - if you haven't already done so. But it is also very good for learning, if you try to convert the sql file you refer to in your OP.

Ok. I got it. Little difficult for me to navigate around GitHub and I actually have some of my code there. Also I'm very new to SQL and MySQL. Just realized after reading your post that I first create the database with northwind.sql and then import the data into it with another import of northwind-data.sql.

Thanks a bunch Quantum! :)
 
  • Like
Likes   Reactions: QuantumQuest