Page 1 of 1

don't use hyphens

Posted: Wed Feb 09, 2011 1:39 pm
by uptoeleven
This is a mysql issue, not specifically a CMS Made Simple issue but in as much as CMSMS runs on MySQL it is relevant.

I just did a major server upgrade (running Plesk on CentOS so did "yum update") and one of my CMSMS websites disappeared.

On looking for the database I found eventually that the database wasn't there... only I could kind of see it... and when I looked for the data I eventually found it BUT the table's name had been changed. Before my table was called "ebc-cms". Now it was called "#mysql50#ebc-cms".

So, if you have done yum update and one or more of your databases has disappeared and you can see it in there but it's called #mysql50#whatever-cms then this may work for you:

In phpmyadmin (or at a mysql command line if you're the adventurous sort) run ALTER DATABASE `#mysql50#whatever-cms` UPGRADE DATA DIRECTORY NAME;

This generates an error but it brings your database back.

What has happened is that hyphens are not necessarily safe for all file systems so mysql trashes your database. I realise that this makes little sense (if hyphens worked before they won't suddenly stop working because you upgraded mysql!) but it's not me that did it, it's mysql.

The moral of the story, please don't use hyphens in your database names as mysql doesn't like them and does mad stuff...