Help importing Northwind db to mysql

  • Thread starter Thread starter aheight
  • Start date Start date
  • Tags Tags
    Db Mysql
Click For Summary
The discussion centers on issues related to importing the Northwind database into MySQL using phpMyAdmin. The user encounters multiple error messages, primarily due to unexpected characters in the SQL file, specifically the "$" character, which is not compatible with MySQL syntax. Suggestions include using the nwind.exe command for installation instead of phpMyAdmin, and exploring alternative methods such as exporting the database from Microsoft Access via ODBC. For users without Access, a GitHub repository containing MySQL-compatible versions of the Northwind database is recommended, with specific files already converted for use. Additionally, users are advised to create the database first using the northwind.sql file and then import the data from northwind-data.sql. The importance of learning GitHub and MySQL Workbench for database management is also highlighted.
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 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 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 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 QuantumQuest
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...