Jump to content

[SOLVED] Cannot restore / table exists issue


Recommended Posts

I'm desperate. I am using mysql 5.0.77 on Mac with PHP Version 5.2.9. I am using navicat for mysql for mac as a client. I have a backup which I am trying to reload. When I'm trying to do that I receive a message saying table 'x' already exists. the table doesnt show up in the list of tables that were restored.


when I try to create the table in phpmyadmin i get a message that the table exists. But when i try to drop it I got a message saying it doesnt exist. This is an innodb table. Anyone can tell me why I am trouble with this table?


Any help is much appreciated.


Link to comment
Share on other sites

Did this backup come from the same system and same mysql version you are trying to restore it on?


Have you opened this backup file using an editor of any kind, even if you only viewed the contents in it or did you specifically make any changes in the file?


What does the backup file have in it starting a few lines before the table definition that is not working and what does it have as the table name/table definition at the point where it is not working?


I am thinking you have some special/invalid character(s) as part of the table name. You could also have some SQL code as part of your data in a column but it did not get properly quoted in the backup and it is breaking the SQL syntax during the restore operation.


Short-answer: You need to post actual information about what is specifically not working so that someone could see if it contains something that could cause the symptoms you are getting.


In computers and programming, due to their general purpose nature, there is not a "one symptom/error" equals "only one specific cause" relationship. The same symptom or error can be caused by a dozen different things and it takes seeing what you are actually doing or what your data is in order to eliminate which of the possible reasons are not causing the problem and to narrow down the reasons that could be causing the problem.

Link to comment
Share on other sites

One thing that comes to my mind, is that whole backup is enclosed into a single transaction, but it contains to CREATE TABLE statements... When it fails, whole thing is rolled back...


I must check however, if CREATE TABLE does not trigger autocommit...




Yup, it does:



So that's not the case

Link to comment
Share on other sites

It's also possible that you are examining information in one database but the backup is being restored to a different one. Perhaps you have one database named ABC and one named abc. These would not be the same databases on an operating system that is filename-case-sensitive.

Link to comment
Share on other sites

You are definitely right about the one mistake can have several causes. I did reload from the same software i made the backup from. the name of the table that's giving some problem is CostTreePath. It's the only table that has capital letters and the only one giving me the issue. I don't know if there's a correlation. Also when i created the data from definition there were some errors. I don't know if some bad stuff was added with time to the database that prevented the reload but I just backed up stuff and reloaded successfully. Since it's test data that I was trying to reload I consider the issue resolved and will take it from there.


Thanks you all


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.