Simple import not happening

[expired user #6648]'s profile image [expired user #6648] posted 11 years ago in General Permalink
Hi all i want to import a text or csv file using "import" on heidisql but the database im importing too is blank, so it wont let me do it without a table, why cant i just copy/paste SQL and run query like you can do in phpmyadmin? its extremely frustrating, its taken me an hour so far!
please help!
ansgar's profile image ansgar posted 11 years ago Permalink
A CSV file does not contain structure, only data. So, you need to create a table before you can import a file into it. Makes sense, doesn't it?
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
Hi Anse, thank you for your response is there anyway of just copying and pasting an SQL dump into a fresh database? just like you can in phpmyadmin? my database has about 700 tables so i cant build every single table!
ansgar's profile image ansgar posted 11 years ago Permalink

why cant i just copy/paste SQL and run query like you can do in phpmyadmin? its extremely frustrating, its taken me an hour so far!



Well, you can. SQL is not the problem, just load or paste some SQL queries into the query tab and press the "Execute" button (F9). But you said you have a CSV file, not an SQL file, so I'm confused now.
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
yes i have done that so i have one tab that has my empty database and another tab which has my SQL dump in it - how do i get the SQL dump into my database!?
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
ok ive done that but it keeps finding small errors, anyway to bypass them
ansgar's profile image ansgar posted 11 years ago Permalink
And what are these "small errors" ? Just post error messages here please.
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
SQL Error (1062) Duplicate Entry '1 for key1

which want to overwrite and then it gives an error to an individual table but i cant post that until this first one is fixed
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
second error attachedhttp://www.ultimadevelopments.info/oxford2012/heidisqlerror.png
[expired user #6648]'s profile image [expired user #6648] posted 11 years ago Permalink
it says duplicates but the tables just are not posting into the database
ansgar's profile image ansgar posted 11 years ago Permalink
* "Duplicate Entry": You have a unique or primary key in that table and the script contains more than 1 row with the same value ("1" in your case)
* "USING BTREE" is not supported by MySQL 5.0 and older. See here, or just remove the "USING BTREE" from your script.

I guess you are trying to run a script from a 5.5 server onto an older server?

Please login to leave a reply, or register at first.