Trying to import a .sql file into MySQL on windows

CaviB

Google Hammered 24/7
Jul 11, 2009
520
3
0
Canada
I have been at this for hours now, I am running xampp on my windows pc and want to import a data.sql file into my database

this is the command I have been using in the terminal
mysql -u username -ppassword < query_file.sql
mysql -u admin -pnotworking < fucking_file.sql

Thanks to anyone that can help


 


mysql -u admin -p=xxxxxxx somedb < C:\xampp\mysql\data\info_user.sql

This is what I am doing and it says file not found , thats the whole path up there and I am assuming this is done while not logged into the terminal, I have 4 books on php and mysql and none of them go over this shit,
 
try using mysqlimport and even putting the datafile in the bin folder with the executables so you won't have to use path.

I've done this several times on different Windows machines and each time I ended up doing something completely different than before to get it to work.
 
could you show me the exact syntax for that? I'm looking at the mysql site now and I can't find anything , Fuck me this is frustrating.
 
YEAH !!!! I finally figured it out I had to go into the directory where the file is located and then do the command below
mysql - u user -p path\filename.sql

I'm reading Head First PHP & MySQL , it's beyond me why they didn't tell you how to do this in the book. Plus the damm book is loaded with errors and typos so if something isn't working I always have to refer to the errata.
Thanks for the help guys.
 
ditch the book of errors and just start reading the documentation. it'll be more confusing at first, but why would you want to learn it wrong the first time?