Help importing Northwind db to mysql

  • Thread starter aheight
  • Start date
  • Tags
    Db Mysql
In summary, jedishrfu is having difficulty importing the Northwind database into MySQL on his machine. He attempted to do so using the nwind.exe command and received 78 errors. He also looked into using MySQL Workbench, but it is also good to learn how to use GitHub.
  • #1
aheight
321
109
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
  • #2
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
  • #3
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
  • #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:
  • #5
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
  • #6
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

Related to Help importing Northwind db to mysql

1. How do I download the Northwind database?

The Northwind database is not available for download as it is a sample database created by Microsoft for demonstration purposes. However, it can be found in some versions of Microsoft Access and can be downloaded from various online sources.

2. Can I import the Northwind database into MySQL?

Yes, it is possible to import the Northwind database into MySQL. However, the process may vary depending on the version of MySQL you are using. It is recommended to consult the official MySQL documentation for specific instructions.

3. What are the steps for importing the Northwind database into MySQL?

The general steps for importing the Northwind database into MySQL are: 1) Download the Northwind database in .mdb format, 2) Convert the .mdb file to .sql format using a conversion tool, 3) Create a new database in MySQL, 4) Import the .sql file into the newly created database using the MySQL command line or a GUI tool.

4. Why is it important to import the Northwind database into MySQL?

Importing the Northwind database into MySQL allows users to practice and learn SQL queries and database management using a real-world example. It also allows for testing and experimenting with MySQL's features and capabilities.

5. Are there any alternatives to importing the Northwind database into MySQL?

Yes, there are alternative sample databases available for MySQL such as the Sakila database and the Employees database. These databases can also be used for learning and practicing SQL queries and database management in MySQL.

Back
Top