dbTalk Databases Forums  

Is this file corrupt?

comp.databases.mysql comp.databases.mysql


Discuss Is this file corrupt? in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ivan at sustainablemarketing [dot] com
 
Posts: n/a

Default Is this file corrupt? - 01-03-2007 , 02:31 PM






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?


Reply With Quote
  #2  
Old   
Michael Austin
 
Posts: n/a

Default Re: Is this file corrupt? - 01-03-2007 , 08:41 PM






ivan at sustainablemarketing [dot] com wrote:

Quote:
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


Reply With Quote
  #3  
Old   
Sean
 
Posts: n/a

Default Re: Is this file corrupt? - 01-04-2007 , 03:27 AM



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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.