ım working localhost, after my work end. I want a upload my db server phpmyadmin. But still syntax error how can ı fix this?
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 ‘(6) NULL DEFAULT NULL,
PRIMARY KEY (id
) USING BTREE
) ENGINE = InnoDB AUTO’ at line 7 )
DROP TABLE IF EXISTS `veriler`;
CREATE TABLE `veriler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kullanici` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`gpa` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`durumu` int(10) NULL DEFAULT NULL,
`miktari` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`tarih` datetime(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
2
Answers
Try this simplified version:
Support for fractional seconds in
DATETIME
values wasn’t added until version MySQL 5.6. If you can’t upgrade your server, you will need to remove the trailing(6)
from the definition of columntarih
i.e.Note that you will lose precision in those values relative to your MariaDB server. If you need to store microseconds in your data values, you will need to upgrade the MySQL server to version 5.6 or later.