MySQL Forums
Forum List  »  General

Re: MySQL corrupting database everytime it starts
Posted by: Rick James
Date: June 02, 2014 10:09PM

> the ONLY configuration i did to the server at all, was add "lower_case_table_names = 2" to turn off lowercase table names.

Dangerous on Windows. Windows does case folding; MySQL cannot avoid it. You possibly ended up with database(s) and/or table(s) that were halfway conflicting -- 'FOO' versus 'foo'. In Linux those are clearly different names; in Windows they are usually the same.

> but i am unable to access the tables or even delete the database.

DROP TABLE ...; DROP DATABASE ...; Do _not_ mess with the files you see on the filesystem.

> but all of mine get corrupted and unusable

Let's see the sequence of events, complete with the actual names.

Another thing to note: "/" and "\" are not good characters to have in database/table names.

> start it as administrator

XAMPP should have "done the right thing".

> #1813 - Tablespace for table '`minecraft`.`users`' exists. Please DISCARD the tablespace before IMPORT.

What command initiated the "IMPORT"?
And it sounds like case folding troubles.

> "innodb_file_per_table" in the config

That addresses a minor issue that is not relevant yet.

> deleted the ib_logfile0, ib_logfile1, and ibdata1 files. it let me actually delete the database from the MySQL interface.

No. Deleting those three files throws away all your InnoDB tables, but leaves behind the table definitions. Again, don't touch the files.

> #1010 - Error dropping database (can't rmdir '.\minecraft', errno: 41)

C:\> perror 41
OS error code 41: Directory not empty

> character-set-server=utf8
> collation-server=utf8_unicode_ci

Those deal with the conversion of bytes between character sets. Not relevant to the problem at hand.

> it saves as users.ibd and the one i can access is saved as Users.frm

With file_per_table, an InnoDB table `users` is manifested in three places:
* ibdata1 (meta information)
* users.frm (essentially the CREATE TABLE)
* users.ibd (all the data indexes)
Removing any of them will "corrupt" the table `users`. Removing ibdata1 causes lots of corruption because non-table information.

Bottom line...
* Don't mess with the files.
* Don't change the config
* Be consistent in upper/lower case-ness in names.
* If Minecraft is being sloppy about case-folding, complain to them.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL corrupting database everytime it starts
June 02, 2014 10:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.