0

I have google the problem I guess I am not the expert in sql thats why I cant seem to solve it.

I am exporting database from dedicated server and trying to import into google cloud instance apache / sql I get error like below even I tried all answers in stackoverflow

Error
SQL query:


CREATE TABLE `islemler` (
  `islemID` int(11) NOT NULL,
  `islemKullaniciID` int(11) NOT NULL,
  `islemTarih` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `islemBitisTarihi` datetime DEFAULT NULL,
  `islemDurum` varchar(500) COLLATE utf8_turkish_ci NOT NULL,
  `islemNot` varchar(500) COLLATE utf8_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci
MySQL said: Documentation

1067 - Invalid default value for 'islemTarih'

please see the screen shot from link Old database

New Database error

I appreciate some help...


As additional

I manage to create all tables manual, as much as from my sql knowledge. I run below commands CREATE TABLE oradamis_vt.islemler ( islemID INT(11) NOT NULL , islemKullaniciID INT(11) NOT NULL , islemTarih DATETIME NOT NULL , islemBitisTarihi DATETIME NOT NULL , islemDurum VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , islemNot VARCHAR(500) CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL ) ENGINE = InnoDB;

CREATE TABLE oradamis_vt.kullanicilar ( kullaniciID INT(11) NOT NULL , username VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , password VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciAdi VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciPozisyon VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciSkype VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciMail VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciTelefon VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , kullaniciYetki VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL ) ENGINE = InnoDB;

CREATE TABLE oradamis_vt.version ( versionNumber INT(11) NOT NULL , sonIslemKullanici VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL , sonIslem VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL ) ENGINE = InnoDB;

But at the end when I try to import from old SQL gives same error of startup.

quite frustrated :(

kerem
  • 81
  • 7

1 Answers1

0

Try replacing with:

CREATE TABLE islemler ( islemID int(11) NOT NULL, islemKullaniciID int(11) NOT NULL, islemTarih timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, islemBitisTarihi datetime DEFAULT NULL, islemDurum varchar(500) COLLATE utf8_turkish_ci NOT NULL, islemNot varchar(500) COLLATE utf8_turkish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci MySQL said: Documentation
  • I run in sql command error came up as below. MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MySQL said: Documentation' at line 1 – kerem Oct 18 '17 at 15:59
  • I tried to find CREATE TABLE islemler in SQL Export file but couldnt find anything relevant. please see the screen shot. http://prntscr.com/gz06dn – kerem Oct 18 '17 at 16:02
  • After digging more and editing export file from old sql export. I got more errors now :o screen shot http://prntscr.com/gz09uu – kerem Oct 18 '17 at 16:09
  • So, try replacing CURRENT_TIMESTAMP with CURRENT_TIMESTAMP(). Let me know –  Oct 18 '17 at 17:07
  • still same errror. http://prntscr.com/gz4z22 check this screen shot please. if I did coding right http://prntscr.com/gz4zha – kerem Oct 18 '17 at 22:06