Quantcast
Viewing all articles
Browse latest Browse all 3472

Error lors de l'importation d'une base de données (7 réponses)

Bonjour,

Voici mon fichier sql :

-- phpMyAdmin SQL Dump
-- version 4.1.14
-- [www.phpmyadmin.net]
--
-- Client : 127.0.0.1
-- Généré le : Jeu 26 Juin 2014 à 16:02
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Base de données : `catalogue`
--

-- --------------------------------------------------------

--
-- Structure de la table `articles`
--

CREATE TABLE IF NOT EXISTS `articles` (
`reference` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`prix` decimal(5,2) NOT NULL,
`description` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`famillesID` tinyint(4) NOT NULL,
PRIMARY KEY (`reference`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `articles`
--

INSERT INTO `articles` (`reference`, `prix`, `description`, `famillesID`) VALUES
('AMP32', '800.00', 'Ampli guitare', 2),
('ART56', '600.00', 'Guitare Archtop', 1),
('GIB78', '400.00', 'Guitare Gibson', 1),
('MIC86', '200.00', 'Micro guitare', 2);

-- --------------------------------------------------------

--
-- Structure de la table `familles`
--

CREATE TABLE IF NOT EXISTS `familles` (
`ID` tinyint(4) NOT NULL AUTO_INCREMENT,
`Intitule` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Contenu de la table `familles`
--

INSERT INTO `familles` (`ID`, `Intitule`) VALUES
(1, 'Guitare'),
(2, 'Accessoire');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Lorsque j'essaye de l'importer dans phpMyAdmin, j'ai l'erreur suivante :

Erreur

Requête SQL :



--
-- Contenu de la table `familles`
--

INSERT INTO `familles` (`ID`, `Intitule`) VALUES
(1, 'Guitare'),
(2, 'Accessoire');

MySQL a répondu: Documentation
#1062 - Duplicate entry '1' for key 'PRIMARY'


Pouvez-vous m'aider ?

Viewing all articles
Browse latest Browse all 3472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>