This is a discussion on Is this file corrupt? within the MySQL forums, part of the Database Server Software category; --> I got this file from another web host. It has some syntax that I have not seen before. Importing ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I got this file from another web host. It has some syntax that I have not seen before. Importing it gererates an error. ERROR 1064 at line 2: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ID` smallint(10) NOT NULL auto_increment, `County` varchar(25 head -100 grcadmi_GRCDB-1.sql CREATE TABLE `12COUNTIES` (e `12COUNTIES`------------------ `ID` smallint(10) NOT NULL auto_increment, `County` varchar(255) NOT NULL default '', `City` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) CREATE TABLE `9COUNTIES` (le `9COUNTIES`-------------------inos');ista') `ID` smallint(10) NOT NULL auto_increment, `County` varchar(255) NOT NULL default '', `City` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) CREATE TABLE `AAE_INTAKE` (e `AAE_INTAKE`------------------)');ion');osta)'); `IntakeID` int(10) NOT NULL auto_increment, `IntakeDate` datetime NOT NULL default '0000-00-00 00:00:00', `IntakeCompleted` varchar(5) NOT NULL default '', `ContactID` int(10) NOT NULL default '0 specifically I think the long lines of dashes are causing the error? I am not sure though. Does anyone know? Is there a way to fix the file? |
| |||
| ivan at sustainablemarketing [dot] com wrote: > I got this file from another web host. It has some syntax that I have > not seen before. Importing it gererates an error. > > ERROR 1064 at line 2: You have an error in your SQL syntax. Check the > manual that corresponds to your MySQL server version for the right > syntax to use near 'ID` smallint(10) NOT NULL auto_increment, > `County` varchar(25 > > > head -100 grcadmi_GRCDB-1.sql > CREATE TABLE `12COUNTIES` (e `12COUNTIES`------------------ > `ID` smallint(10) NOT NULL auto_increment, > `County` varchar(255) NOT NULL default '', > `City` varchar(255) NOT NULL default '', > PRIMARY KEY (`ID`) > CREATE TABLE `9COUNTIES` (le > `9COUNTIES`-------------------inos');ista') > `ID` smallint(10) NOT NULL auto_increment, > `County` varchar(255) NOT NULL default '', > `City` varchar(255) NOT NULL default '', > PRIMARY KEY (`ID`) > CREATE TABLE `AAE_INTAKE` (e > `AAE_INTAKE`------------------)');ion');osta)'); > `IntakeID` int(10) NOT NULL auto_increment, > `IntakeDate` datetime NOT NULL default '0000-00-00 00:00:00', > `IntakeCompleted` varchar(5) NOT NULL default '', > `ContactID` int(10) NOT NULL default '0 > > > specifically I think the long lines of dashes are causing the error? I > am not sure though. Does anyone know? Is there a way to fix the file? > looks like the file needs some cleanup... what kind of file (mysqldump??)? -- Michael Austin. Database Consultant |
| ||||
| If I cut/paste into MySQL it complains like mad, as does yours. But with a little tidy up, I have the following, which work fine. So in answer to your question, I would say that the long lines of dashes are your problem. Are there some options that you can configure for the output dump in the program you have used to create the file? It could be that your program is dumping the data to file with the intention that it will be used to read the file back in, rather than you trying to use the content of the dumped data. CREATE TABLE `12COUNTIES` ( `ID` smallint(10) NOT NULL auto_increment, `County` varchar(255) NOT NULL default '', `City` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ); CREATE TABLE `9COUNTIES` ( `ID` smallint(10) NOT NULL auto_increment, `County` varchar(255) NOT NULL default '', `City` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ); CREATE TABLE `AAE_INTAKE` ( `IntakeID` int(10) NOT NULL auto_increment, `IntakeDate` datetime NOT NULL default '0000-00-00 00:00:00', `IntakeCompleted` varchar(5) NOT NULL default '', `ContactID` int(10) NOT NULL default '0', PRIMARY KEY (`IntakeID`) ) SA |
| Thread Tools | |
| Display Modes | |
|
|