O'Reilly Forums: Head First Download Tables How To Import - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Head First Download Tables How To Import

#1 User is offline   halbritter 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 05-October 12

Posted 05 October 2012 - 09:35 AM

Hi everyone. I am working through the book and have downloaded the table files but I'm not clear on how to import them into mysql (using command prompt). Do I need to make a database first to put them into or? First I tried using the command to import databases before looking again and seeing that they are tables?

Thanks in advance for the help.

La
0

#2 User is offline   Blacksheep 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 12-October 12

Posted 12 October 2012 - 11:46 PM

Hello

I had the same issue I found the following solution and it worked for me.

1. Navigate to the directory where your .sql file is.
2. Type this this command:
mysql -p -u username database_name < file.sql

Have a go and let me know.
Regards
0

#3 User is offline   XYMZ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 29-November 12

Posted 29 November 2012 - 09:49 PM

Hello Blacksheep,

Could you kindly give a more detailed explanation. I have the files in a folder on my desktop but I do not understand these things:

a) in the command you gave, what is 'username'? when i downloaded sql, i don't think i put in a username or is the word 'username' a part of the command itself?
B) what should the 'database_name' be? for example for boys.sql, is it only boys <file.sql or boys.sql<file.sql
c) i assume you are navigating in the command prompt. i have my folder on c:\sq but when i navigate to it and try to type the command, mysql say it cannot find the file.

It would be great if you could put up a video like this (although i tried this too and it did not work.)

and without uploading the files, it is impossible to learn sql :(
0

#4 User is offline   XYMZ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 29-November 12

Posted 29 November 2012 - 09:52 PM

sorry i guess the system filters out external links. the link to the video is this. www(dot)youtube(dot)com/watch?v=6HSVXJZk0aE
0

#5 User is offline   drewdin 

  • Super Veteran Member
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 608
  • Joined: 11-February 10
  • Gender:Male
  • Location:Boston

Posted 03 March 2013 - 06:49 PM

This didnt work for me, I tried source and the other way to no avail.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users