Jump to content


Photo

Head First Download Tables How To Import


  • Please log in to reply
4 replies to this topic

#1 halbritter

halbritter

    New Member

  • Members
  • Pip
  • 1 posts

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

#2 Blacksheep

Blacksheep

    New Member

  • Members
  • Pip
  • 1 posts

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

#3 XYMZ

XYMZ

    New Member

  • Members
  • Pip
  • 2 posts

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 :(

#4 XYMZ

XYMZ

    New Member

  • Members
  • Pip
  • 2 posts

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

#5 drewdin

drewdin

    Super Veteran Member

  • Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 608 posts
  • 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 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users