Preston Taylor Holmes
Knoxville, TN

The Cranky Neocon
Philadelphia, PA

Brian McMurphy
Nashville, TN

Michele
Knoxville, TN

Nigel
San Diego, CA

TinyElvis
The O.C., California

Yiddish Steel
San Diego, CA

Annika!
Parts Unknown, California



Headlines...

The Dirty Dozen...


6MB: The Sadie
Lou Interview


6MB Backup Site


All original content
© 2004 - 2009
Six Meat Buffet

All other content
© Someone Else

Terms of Use





















Supergeek MySQL Tech Bleg

January 10th, 2009 at 11:06 pm by Preston Taylor Holmes

This is the kind of post that can make your eyes roll back in your head, so go no further unless you’re interested in MySQL databases and the like.

Here’s my bleg. I need some help with my MySQL database. Here’s the poop – I’m trying to export both my comments and posts tables (both of which are large), then import the comments to a new/test database on the same MySQL server.

I’ve exported the comments file in a varity of compatibility modes (MYSQL40, 323, ANSI, NONE) and every time I try to restore it, I get the same error.

“#1064 – 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 ” at line 76″

I’m baffled because I’m exported from and importing to the same MySQL db server, and none of the compatibility versions seem to make a difference.

If anyone has any suggestions, in the words of Ross Perot, I’m all ears. You can shoot me an e-mail at preston at this here domain (you know the drill). Thanks!


6 Responses to “Supergeek MySQL Tech Bleg”

  1. Chris Short Says:

    Try splitting it up into multiple backups then look for malformed syntax in the comments that might be mucking up the works.

  2. Doug H Says:

    I’m used to MS SQL Server, rather than MySQL, but have you tried inserting directly from one database to the other?

    In transact SQL, the syntax is DATABASE_NAME.OWNER.TABLE_NAME

    So inserting into a table in another database would look like:
    Insert Into TestDatabase.dbo.Comments (field, list, here)
    Select field, list, here from dbo.Comments

    Again, I don’t know if this syntax works in MySQL, but that’s how I would do it in full SQL Server.

  3. badanov Says:

    I have essentially a similar problem with backups using PostgreSQL.

    In PostgreSQL I have the option of dumping data using PG’s own format or a more universal INSERT mode, which enables me to export to any other SQL database. For some reason that PG mode doesn’t work but the universal mode works famously

  4. Preston Taylor Holmes Says:

    I was able to overcome my main issue by migrating all my dbs to the same server, which enabled me to copy the db. I have a feeling the problem with my export/import is the collation my DB is in, so I may have a fix for that but haven’t had time to mess with it. Thanks for the help guys.

  5. Les Jones Says:

    Just wait a few days. Once Obama is in office all SQL queries will return the correct results. Also, you’ll be able to successfully divide by zero.

  6. Cappy Says:

    Yeah. Man up and use a real DBMS. :twisted: