PDA

View Full Version : Load mysql from .dat file


umbongo
09-06-2006, 11:35 PM
Hi, I've been following a tutorial on mysql. In one part it explains how to import a query (in a .dat file) from the command line:

1). Move the file to c:\mysql\bin.
2). Make sure MySQL is running.
3). Issue the following command
mysql employees <employee.dat

employee.dat just contains queries like this:
INSERT INTO employee_data (f_name, l_name, title, age, yos, salary, perks, email) values ("John", "Hagan", "Senior Programmer", 32, 4, 120000, 25000, "john_hagan@bignet.com");

But it doesn't seem to work when I issue the command in step 3). I just get an error 1064.
I've read that error 1064 is the result of mysql version mismatch. How do I find out the mysql version from the command line?
Is there a different/better way to get that info into my tables?

umbongo
09-08-2006, 08:29 PM
Ok, sorted it. I was trying to do it form the mysql prompt. I quit that and navigated to the folder with the regular command prompt and it worked.

hliuzia
01-11-2007, 02:36 AM
I see that I am currently using the same tutorial that you used before. I am still having that problem. Can you help me? I am learning MySQL and i want to know how to import .dat files. I tried the usual cmd but it didnt seem to work. Thank you

umbongo
01-11-2007, 05:22 PM
Hi,
It was a long time ago, and I can't remember the url of the tutorial now, so can't check it.
But from what I remember, it wouldn't work innitially because I was trying to perform the import in the .dat using the command console, but with the mysql> prompt. I exited from the mysql> prompt and it worked.

Hope that helps.