» »

MySQL problem

MySQL problem

mitja ::

Zdravo!

Tole podatkovno bazo želim naložiti na server:

--
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE SCHEMA IF NOT EXISTS `mitzen01_veem` DEFAULT CHARACTER SET utf8 COLLATE utf8_slovenian_ci ;
USE `mitzen01_veem` ;

-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sc_log`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sc_log` (
  `id` INT(8) NOT NULL AUTO_INCREMENT ,
  `inserted_date`  NULL DEFAULT NULL ,
  `username` VARCHAR(90) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `application` VARCHAR(200) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `creator` VARCHAR(30) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `ip_user` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `action` VARCHAR(30) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `description` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`id`) )
ENGINE = MyISAM
AUTO_INCREMENT = 346
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_apps`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_apps` (
  `app_name` VARCHAR(128) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `app_type` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `description` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`app_name`) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_groups`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_groups` (
  `group_id` INT(11) NOT NULL AUTO_INCREMENT ,
  `description` VARCHAR(64) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`group_id`) ,
  UNIQUE INDEX `description` (`description` ASC) )
ENGINE = MyISAM
AUTO_INCREMENT = 3
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_groups_apps`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_groups_apps` (
  `group_id` INT(11) NOT NULL ,
  `app_name` VARCHAR(128) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `priv_access` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_insert` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_delete` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_update` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_export` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_print` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`group_id`, `app_name`) ,
  INDEX `sec_groups_apps_ibfk_2` (`app_name` ASC) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_logged`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_logged` (
  `login` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `date_login` VARCHAR(128) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `sc_session` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`login`) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_users`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_users` (
  `login` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `pswd` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `name` VARCHAR(64) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `email` VARCHAR(64) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `active` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `activation_code` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `priv_admin` VARCHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  PRIMARY KEY (`login`) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sec_users_groups`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`sec_users_groups` (
  `login` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `group_id` INT(11) NOT NULL ,
  PRIMARY KEY (`login`, `group_id`) ,
  INDEX `sec_users_groups_ibfk_2` (`group_id` ASC) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`skupno_PostneStevilke`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`skupno_PostneStevilke` (
  `idPosta` INT(11) NOT NULL AUTO_INCREMENT ,
  `Posta` VARCHAR(60) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `PostnaStevilka` VARCHAR(20) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `VelikiUporabnik` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `Drzava` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  PRIMARY KEY (`idPosta`) )
ENGINE = MyISAM
AUTO_INCREMENT = 2
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci
COMMENT = 'Seznam pošt';


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`skupno_Partnerji`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`skupno_Partnerji` (
  `idPartner` INT(11) NOT NULL AUTO_INCREMENT ,
  `Naziv` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `Zanesljivost` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `Ulica` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `idPosta` INT(11) NOT NULL DEFAULT NULL ,
  `Telefon` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `Fax` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `GSM` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `Email` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `KontaktnaOseba` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `DavcnaStevilka` VARCHAR(8) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `ZavezanecDDV` CHAR(1) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `MaticnaStevilka` INT(10) NULL DEFAULT NULL ,
  `SpletnaStran` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
  `Opombe` LONGTEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `group_id` INT(11) NULL DEFAULT NULL ,
  PRIMARY KEY (`idPartner`, `idPosta`) ,
  INDEX `fk_skupno_Partnerji_skupno_PostneStevilke_idx` (`idPosta` ASC) )
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci
COMMENT = 'Seznam partnerjev';


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`test`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`test` (
  `id` INT(11) NOT NULL AUTO_INCREMENT ,
  `group_id` INT(11) NOT NULL ,
  `login` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  `kontrolniPodatek` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
  PRIMARY KEY (`id`) )
ENGINE = MyISAM
AUTO_INCREMENT = 10
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_slovenian_ci;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`ZZasV_Spisi`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`ZZasV_Spisi` (
  `idZZasV_Spisi` INT NOT NULL AUTO_INCREMENT ,
  `StopnjaTajnosti` VARCHAR(45) NULL ,
  `ImePriimekNaziv` VARCHAR(45) NULL ,
  `Opis` TEXT NULL ,
  `OcenaStopnjeTajnosti` VARCHAR(45) NULL ,
  `MinimalnaDobaHrambePodatkov` VARCHAR(45) NULL ,
  `group_id` INT NULL ,
  PRIMARY KEY (`idZZasV_Spisi`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`ZZasV_Zaposleni`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`ZZasV_Zaposleni` (
  `idZZasV_Zaposleni` INT NOT NULL AUTO_INCREMENT ,
  `group_id` INT NULL ,
  `idZZasV_Spisi` INT NULL ,
  `Ime` VARCHAR(45) NULL ,
  `Priimek` VARCHAR(45) NULL ,
  `StalnoPrebivalisce` TEXT NULL ,
  `idPosta_StalnoPrebivalisce` INT NULL ,
  `ZacasnoPrebivalisce` TEXT NULL ,
  `idPosta_ZacasnoPrebivalisce` INT NULL ,
  `DatumRojstva` DATETIME NULL ,
  `KrajInDrzavaRojstva` VARCHAR(45) NULL ,
  `EMSO` VARCHAR(45) NULL ,
  `DavcnaStevilkal` VARCHAR(45) NULL ,
  `Drzavljanstvo` VARCHAR(45) NULL ,
  `Telefon` VARCHAR(45) NULL ,
  `Email` VARCHAR(45) NULL ,
  `Opombe` LONGTEXT NULL ,
  `Aktiven` CHAR(1) NULL ,
  PRIMARY KEY (`idZZasV_Zaposleni`) ,
  INDEX `fk_ZZasV_Zaposleni_ZZasV_Spisi1_idx` (`idZZasV_Spisi` ASC) ,
  INDEX `fk_ZZasV_Zaposleni_skupno_PostneStevilke1_idx` (`idPosta_StalnoPrebivalisce` ASC) ,
  INDEX `fk_ZZasV_Zaposleni_skupno_PostneStevilke2_idx` (`idPosta_ZacasnoPrebivalisce` ASC) ,
  CONSTRAINT `fk_ZZasV_Zaposleni_ZZasV_Spisi1`
    FOREIGN KEY (`idZZasV_Spisi` )
    REFERENCES `mitzen01_veem`.`ZZasV_Spisi` (`idZZasV_Spisi` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ZZasV_Zaposleni_skupno_PostneStevilke1`
    FOREIGN KEY (`idPosta_StalnoPrebivalisce` )
    REFERENCES `mitzen01_veem`.`skupno_PostneStevilke` (`idPosta` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ZZasV_Zaposleni_skupno_PostneStevilke2`
    FOREIGN KEY (`idPosta_ZacasnoPrebivalisce` )
    REFERENCES `mitzen01_veem`.`skupno_PostneStevilke` (`idPosta` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`ZZasV_Zaposleni_SluzbenaIzkaznica`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`ZZasV_Zaposleni_SluzbenaIzkaznica` (
  `idZZasV_Zaposleni_SluzbenaIzkaznica` INT NOT NULL AUTO_INCREMENT ,
  `idZZasV_Zaposleni` INT NULL ,
  `DatumIzdaje` DATETIME NULL ,
  `StevilkaIzkaznice` VARCHAR(45) NULL ,
  `StrokovnaUsposobljenost` TEXT NULL ,
  `Opombe` LONGTEXT NULL ,
  `Aktivna` CHAR(1) NULL ,
  PRIMARY KEY (`idZZasV_Zaposleni_SluzbenaIzkaznica`) ,
  INDEX `fk_ZZasV_Zaposleni_SluzbenaIzkaznica_ZZasV_Zaposleni1_idx` (`idZZasV_Zaposleni` ASC) ,
  CONSTRAINT `fk_ZZasV_Zaposleni_SluzbenaIzkaznica_ZZasV_Zaposleni1`
    FOREIGN KEY (`idZZasV_Zaposleni` )
    REFERENCES `mitzen01_veem`.`ZZasV_Zaposleni` (`idZZasV_Zaposleni` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mitzen01_veem`.`ZZasV_Zaposleni_Pogodbe`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mitzen01_veem`.`ZZasV_Zaposleni_Pogodbe` (
  `idZZasV_Zaposleni_Pogodbe` INT NOT NULL AUTO_INCREMENT ,
  `idZZasV_Zaposleni` INT NULL ,
  `DatumPredlozitveVzorca` DATETIME NULL ,
  `DatumSklenitve` DATETIME NULL ,
  `DatumZacetkaUporabe` DATETIME NULL ,
  `DatumZakljucka` DATETIME NULL ,
  `Opombe` LONGTEXT NULL ,
  PRIMARY KEY (`idZZasV_Zaposleni_Pogodbe`) ,
  INDEX `fk_ZZasV_Zaposleni_Pogodbe_ZZasV_Zaposleni1_idx` (`idZZasV_Zaposleni` ASC) ,
  CONSTRAINT `fk_ZZasV_Zaposleni_Pogodbe_ZZasV_Zaposleni1`
    FOREIGN KEY (`idZZasV_Zaposleni` )
    REFERENCES `mitzen01_veem`.`ZZasV_Zaposleni` (`idZZasV_Zaposleni` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

USE `mitzen01_veem` ;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
--


Napaka, ki jo vedno dobim, pa naj delam karkoli je: 
Napaka

Poizvedba SQL:

-- -----------------------------------------------------
-- Table `mitzen01_veem`.`sc_log`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mitzen01_veem`.`sc_log` (
`id` INT( 8 ) NOT NULL AUTO_INCREMENT ,
`inserted_date` NULL DEFAULT NULL ,
`username` VARCHAR( 90 ) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
`application` VARCHAR( 200 ) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
`creator` VARCHAR( 30 ) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
`ip_user` VARCHAR( 32 ) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
`action` VARCHAR( 30 ) CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NOT NULL ,
`description` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' NULL DEFAULT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM AUTO_INCREMENT =346 DEFAULT CHARACTER SET = utf8 COLLATE = utf8_slovenian_ci;


MySQL je vrnil: Dokumentacija
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL DEFAULT NULL ,
`username` VARCHAR(90) CHARACTER SET 'utf8' COLLATE 'utf8' at line 6

-----

Vendar bolj kot poskušam, gledam, berem, manj mi je jasno.
Kaka ideja?
Za izgradnjo baz uporabljam: MySQL Workbench

Hvala za pomoč!

// Prosim uporabljajte st.koda značke. -- moderator
Nobody is perfect! But who wants to be nobody?
  • spremenil: Mavrik ()

keworkian ::

CHARACTER SET 'utf8' COLLATE 'utf8_slovenian_ci' 

Odstran
CHARACTER SET 'utf8'
je
 COLLATE 'utf8_slovenian_ci'
dovolj
Obscenities in B-Flat

mitja ::

Sem odstranil. Pa ni šlo.
Sem odstranil tudi COLLATE '*'. ..ista napaka...
Kaka ideja?
Nobody is perfect! But who wants to be nobody?

mile ::

Polje 'inserted_date' nima definiranega tipa, verjetno je DATETIME

mitja ::

V bistvu je to kar sem naredil lep primer gledanja v nekaj kar ima pomanjkljivost zaradi šlamparije. :D
Sem ugotovil, da ima mile prav. V bazi je bilo še ene par takih cvetk.
Hvala vsem za pomoč!
Nobody is perfect! But who wants to be nobody?


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

MySql Vprasanje - problem dupliciranih kljucev

Oddelek: Izdelava spletišč
131167 (989) KernelPanic
»

C# - MySQL - šumniki

Oddelek: Programiranje
51771 (1670) Matthew
»

FULLTEXT indeksi - problemi pri osnovnem primeru

Oddelek: Programiranje
6806 (727) barelyLegal
»

MySQL in czs

Oddelek: Izdelava spletišč
423283 (2373) krho
»

kako spreminiti vse php fajle in celo bazo v utf-8

Oddelek: Izdelava spletišč
161132 (912) Senzacionale

Več podobnih tem