Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help importing Northwind db to mysql

  1. Oct 21, 2016 #1

    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?

  2. jcsd
  3. Oct 21, 2016 #2


    Staff: Mentor

    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.
  4. Oct 21, 2016 #3


    User Avatar
    Science Advisor
    Gold Member

    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.
  5. Oct 22, 2016 #4
    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: Oct 22, 2016
  6. Oct 22, 2016 #5


    User Avatar
    Science Advisor
    Gold Member

    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.
  7. Oct 22, 2016 #6
    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! :)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted