Unix Technical Forum

Is this file corrupt?

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 08:52 AM
ivan at sustainablemarketing [dot] com
 
Posts: n/a
Default Is this file corrupt?

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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 08:52 AM
Michael Austin
 
Posts: n/a
Default Re: Is this file corrupt?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 08:52 AM
Sean
 
Posts: n/a
Default Re: Is this file corrupt?

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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:20 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com