Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Like everyone, I realized the case sensitivity issues in MySQL of late. I wanted to convert my upper case table names to lower case using this solution but I forgot to do Step 1 and completed the remaining steps. Now I couldnt access my tables that are in upper case. Renaming the tables using

mysql>  rename table BOOK to book;
ERROR 1017 (HY000): Can't find file: './las_data_3_dt2014/book.frm' (errno: 2)

returns error.

Unable to use mysqldump on my database.

mysqldump: Got error: 1146: Table 'las_data_3_dt2014.adjustment_type' doesn't exist when using LOCK TABLES 

I want to know if its okay to rename the upper case .FRM files to corresponding lower case files? So that I can run the rename commands and access the data again.

share|improve this question

migrated from stackoverflow.com May 13 '13 at 13:16

This question came from our site for professional and enthusiast programmers.

1  
No, it is not ok. These files are private to the mysqld server. –  Basile Starynkevitch May 12 '13 at 13:52
    
@BasileStarynkevitch What is then the recommended way to get out this issue? –  emaillenin May 12 '13 at 13:52
    
Use MySQL requests only. And do a mysqldump. –  Basile Starynkevitch May 12 '13 at 13:53
    
@BasileStarynkevitch Unable to mysqldump too. Edited question. –  emaillenin May 12 '13 at 13:56

2 Answers 2

up vote 3 down vote accepted

change lower_case_table_names back again

Then you should be able to access your tables.

But yes, as long as they as MyISAM tables you CAN rename them. Best to do it while mysql is shutdown. Need to change the MYD and MYI files too.

share|improve this answer

If the table is MyISAM, make sure the case is as follows

  • mv BOOK.FRM BOOK.frm
  • mv BOOK.myd BOOK.MYD
  • mv BOOK.myi BOOK.MYI

If the table is InnoDB, that could a little because the data dictionary within ibdata1 would know what the file's name was originally. Notwithstanding, you could rename the file the same way.

You should also make sure the file has the correct ownership.

chown mysq:mysql BOOK.frm

Give it a Try !!!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.