Home:ALL Converter>mysql database data import error

mysql database data import error

Ask Time:2017-01-19T18:06:15         Author:Adam Stroud

Json Formatter

When I go to import data into mysql, using the wizard, from a csv file it gives me this error :

Starting...

Prepare Import...

Prepare Import done

Import data file....

Traceback (most recent call last):

File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\workbench\wizard_progress_page_widget.py", line 192, in thread_work self.func()

File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\sqlide_power_import_wizard.py", line 125, in start_import retval = self.module.start(self.stop)

File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\sqlide_power_import_export_be.py", line 271, in start ret = self.start_import()

File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\sqlide_power_import_export_be.py", line 408, in start_import if not self.prepare_new_table():

File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\sqlide_power_import_export_be.py", line 237, in prepare_new_table self._editor.executeManagementCommand(""" CREATE TABLE %s (%s)""" % (self._table_w_prefix, ", ".join(["%s %s" % (col['name'], col["type"]) for col in self._mapping])), 1)

DBError:

("Incorrect column name ''", 1166)

ERROR:

Import data file: ("Incorrect column name ''", 1166)

Failed

Edit: I forgot to add an actual question to this, can someone help me in solving this error?

Author:Adam Stroud,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41738978/mysql-database-data-import-error
Akash Verma :

Was struggling with the same error. The solution is quite simple though.\n\nIn the .csv file from which you were trying to import data from, if you look closely the field names and rows are in order such as:\n\n;\"created_at\";\"updated_at\";\"country_code\";\"mobile_number\";\"site_context\";\"country\";\"user_id\";\"uuid\"\n1;1547471922220;1547471922220;\"91\";\"9711843454\";\"rexmonster\";\"IN\";0;\"\"\n2;1547471959995;1547471959995;\"91\";\"971184\";\"rexmonster\";\"IN\";0;\"\"\n\n\nHere, the first col. name is null which is creating the error.\nAll you need to do is just provide any column name at that place\ne.g.:\n\n\"SerialNum\";\"created_at\";\"updated_at\";\"country_code\";\"mobile_number\";\"site_context\";\"country\";\"user_id\";\"uuid\"\n1;1547471922220;1547471922220;\"91\";\"9711843454\";\"rexmonster\";\"IN\";0;\"\"\n2;1547471959995;1547471959995;\"91\";\"971184\";\"rexmonster\";\"IN\";0;\"\"\n\n\nBoom you are done. \nThe import will work smooth now!",
2019-02-09T14:00:23
yy