2
问题是部署MySQL DB在Linus上,而在Windows上开发MySQL DB。 DB是InnoDB。因此,出现了区分大小写的表名的问题。 我找到喜欢的解决方案:PHP MySQL InnoDB Unix Windows区分大小写的表名
function getTableName($table_name){
$query="select TABLE_NAME from `information_schema`.`TABLES` where table_name
like '%$table_name%' ";
$result=mysql_query($query,$this->connection);
$err_number=mysql_errno($this->connection);
if (!$err_number){
$num_rows = mysql_num_rows($result);
if ($num_rows==1){
$row = mysql_fetch_assoc($result);
return $row["TABLE_NAME"];
}else {
return "";
}
}else {
return "";
}
}
所以命名为从类型的操作系统来indipendant。但是MySQL可能存在的选择做同样的事情?
我喜欢这个答案(+1这一个),不仅因为它的简洁和了点,但它是非常重要的InnoDB的。约束名称是case sentivite,并且迁移得不好。将表名更改为小写不会限制预算。即使在应用此选项后,请检查所有约束以确保全部都是小写。将InnoDB从Linux迁移到Windows时,这一点尤为重要。 – RolandoMySQLDBA