PhpMyAdmin export : reference without uppercase

时间:2015-06-20 09:41:15

标签: mysql phpmyadmin export

First, I'm sorry for my poor English, I'm french.

I use PhpMyAdmin with Xampp in localhost and an other PhpMyAdmin on server

My tables are like Personne, Adresse, Titre.

When I use the export option with server my sql is perfect :

CREATE TABLE IF NOT EXISTS `Personne` (
  `idPersonne` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gsm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prenom` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `telephone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `idAdresse` int(11) DEFAULT NULL,
  `idTitre` int(11) DEFAULT NULL,
  PRIMARY KEY (`idPersonne`),
  UNIQUE KEY `uniquePersonne` (`nom`,`prenom`),
  KEY `IDX_F6B8ABB9D3E663E4` (`idAdresse`),
  KEY `IDX_F6B8ABB9E8B304A9` (`idTitre`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=685 ;

ALTER TABLE `Personne`
  ADD CONSTRAINT `FK_F6B8ABB9D3E663E4` FOREIGN KEY (`idAdresse`) REFERENCES `Adresse` (`idAdresse`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_F6B8ABB9E8B304A9` FOREIGN KEY (`idTitre`) REFERENCES `Titre` (`idTitre`) ON DELETE SET NULL;

By when I use the local export

CREATE TABLE IF NOT EXISTS `Personne` (
  `idPersonne` int(11) NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gsm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prenom` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `telephone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `idAdresse` int(11) DEFAULT NULL,
  `idTitre` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=685 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

it's makes lines for primary, unique, normal key and auto_increment :

ALTER TABLE `Personne`
  ADD PRIMARY KEY (`idPersonne`), ADD UNIQUE KEY `uniquePersonne` (`nom`,`prenom`), ADD KEY `IDX_F6B8ABB9D3E663E4` (`idAdresse`), ADD KEY `IDX_F6B8ABB9E8B304A9` (`idTitre`);

ALTER TABLE `Personne`
  MODIFY `idPersonne` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=685;

And reference don't contain uppercase

ALTER TABLE `Personne`
  ADD CONSTRAINT `FK_F6B8ABB9D3E663E4` FOREIGN KEY (`idAdresse`) REFERENCES `adresse` (`idAdresse`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_F6B8ABB9E8B304A9` FOREIGN KEY (`idTitre`) REFERENCES `titre` (`idTitre`) ON DELETE SET NULL;

How have the same result of server?

Thank you for your help

1 个答案:

答案 0 :(得分:0)

调整MySQL的lower_case_table_names设置以实现目标。见How to force case sensitive table names?