BOnjour,
Voici ma base de donné :
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: `hybabdd`
--
--
--------------------------------------------------
------
--
-- Structure de la table `client`
--
CREATE TABLE IF NOT EXISTS `client` (
`id_client` int(11) NOT NULL AUTO_INCREMENT,
`nom_client` varchar(20) NOT NULL,
`prenom_client` varchar(20) NOT NULL,
`num_client` int(12) DEFAULT NULL,
`adresse_client` varchar(30) NOT NULL,
KEY `id_client` (`id_client`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Contenu de la table `client`
--
INSERT INTO `client` (`id_client`, `nom_client`, `prenom_client`, `num_client`, `adresse_client`) VALUES
(2, 'paris1', 'tolbiac', NULL, 'rue de tolbiac'),
(3, 'dominos', 'pizza', NULL, '11e');
--
--------------------------------------------------
------
--
-- Structure de la table `contrat`
--
CREATE TABLE IF NOT EXISTS `contrat` (
`id_contrat` int(11) NOT NULL AUTO_INCREMENT,
`type_contrat` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id_contrat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Contenu de la table `contrat`
--
INSERT INTO `contrat` (`id_contrat`, `type_contrat`) VALUES
(3, 'site internet'),
(4, 'une pizza acheter deux pizza offerte');
--
--------------------------------------------------
------
--
-- Structure de la table `employe`
--
CREATE TABLE IF NOT EXISTS `employe` (
`id_employe` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) DEFAULT NULL,
`prenom` varchar(45) DEFAULT NULL,
`statut` varchar(45) DEFAULT NULL,
`num_tel` varchar(45) DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
`username` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id_employe`),
KEY `cles primaire` (`id_employe`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Contenu de la table `employe`
--
INSERT INTO `employe` (`id_employe`, `nom`, `prenom`, `statut`, `num_tel`, `password`, `username`) VALUES
(1, 'Ait si amer', 'Madjid', 'chef de projet', NULL, 'sisi', 'madjid'),
(2, 'Balestan', 'Vincent', 'chef de projet', NULL, 'sisi', 'vincent'),
(6, 'Aissat', 'Alexandre', 'chef de projet', NULL, 'sisi', 'alexandre'),
(7, 'Peju', 'Marie', 'ouvrier', NULL, 'saclas', 'marie'),
(8, 'Minas', 'Annie', 'ouvrier', NULL, 'yelevan', 'Annie'),
(9, 'Abam', 'Said', 'Idiot du village', NULL, 'alkapote', 'said');
--
--------------------------------------------------
------
--
-- Structure de la table `planning`
--
CREATE TABLE IF NOT EXISTS `planning` (
`date_travail` date NOT NULL,
`presence` bit(1) NOT NULL,
`id_projet` int(20) NOT NULL,
`id_emp` int(200) NOT NULL,
PRIMARY KEY (`date_travail`,`id_projet`,`id_emp`),
KEY `id_emp` (`id_emp`),
KEY `id_projet` (`id_projet`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contenu de la table `planning`
--
INSERT INTO `planning` (`date_travail`, `presence`, `id_projet`, `id_emp`) VALUES
('0000-00-00', b'1', 3, 6),
('2012-03-07', b'1', 3, 2);
--
--------------------------------------------------
------
--
-- Structure de la table `projet`
--
CREATE TABLE IF NOT EXISTS `projet` (
`id_projet` int(11) NOT NULL AUTO_INCREMENT,
`nom_projet` varchar(50) NOT NULL,
`id_client` int(11) NOT NULL,
`id_contrat` int(11) NOT NULL,
PRIMARY KEY (`id_projet`),
KEY `id_contrat` (`id_contrat`),
KEY `id_client` (`id_client`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Contenu de la table `projet`
--
INSERT INTO `projet` (`id_projet`, `nom_projet`, `id_client`, `id_contrat`) VALUES
(3, 'manger les coloriages', 2, 3),
(4, 'faire le site internet', 3, 4);
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `planning`
--
ALTER TABLE `planning`
ADD CONSTRAINT `planning_ibfk_1` FOREIGN KEY (`id_emp`) REFERENCES `employe` (`id_employe`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `planning_ibfk_2` FOREIGN KEY (`id_projet`) REFERENCES `projet` (`id_projet`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `projet`
--
ALTER TABLE `projet`
ADD CONSTRAINT `projet_ibfk_1` FOREIGN KEY (`id_projet`) REFERENCES `contrat` (`id_contrat`),
ADD CONSTRAINT `projet_ibfk_6` FOREIGN KEY (`id_client`) REFERENCES `client` (`id_client`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `projet_ibfk_7` FOREIGN KEY (`id_contrat`) REFERENCES `contrat` (`id_contrat`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 je souhaite l'importer cela m'affiche :
Erreur
requête SQL:
--
-- Base de données: `hybabdd`
--
--
--------------------------------------------------
------
--
-- Structure de la table `client`
--
CREATE TABLE IF NOT EXISTS `client` (
`id_client` int( 11 ) NOT NULL AUTO_INCREMENT ,
`nom_client` varchar( 20 ) NOT NULL ,
`prenom_client` varchar( 20 ) NOT NULL ,
`num_client` int( 12 ) DEFAULT NULL ,
`adresse_client` varchar( 30 ) NOT NULL ,
KEY `id_client` ( `id_client` ) ) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT =6;
MySQL a répondu:
- 1046 - No database selected
Pourtant j'arrive a l'importer sur mon autre ordinateur. portable ...
Si quelqu'un pouvait m'indiquer le problème
Merci