simpli Posted October 24, 2009 Share Posted October 24, 2009 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. JR Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/ Share on other sites More sharing options...
Mchl Posted October 24, 2009 Share Posted October 24, 2009 What does 'SHOW TABLES' query say? Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943497 Share on other sites More sharing options...
simpli Posted October 24, 2009 Author Share Posted October 24, 2009 show tables does not show table x. Which is all the more puzzling. JR Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943506 Share on other sites More sharing options...
Mchl Posted October 24, 2009 Share Posted October 24, 2009 Can you run a SELECT on this table? Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943509 Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2009 Share Posted October 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943511 Share on other sites More sharing options...
Mchl Posted October 24, 2009 Share Posted October 24, 2009 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... [edit] Yup, it does: http://dev.mysql.com/doc/refman/5.0/en/implicit-commit.html So that's not the case Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943513 Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2009 Share Posted October 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943515 Share on other sites More sharing options...
simpli Posted October 24, 2009 Author Share Posted October 24, 2009 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 JR Quote Link to comment https://forums.phpfreaks.com/topic/178845-solved-cannot-restore-table-exists-issue/#findComment-943520 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.