Задавайте вопросы, мы ответим
Вы не зашли.
Здравствуйте, переношу таблицу в приложение "Navicat Premium" и при переносе появляется вот такая ошибка, подскажите пожалуйста.
CREATE TABLE `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`hwid` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`socialclub` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`redbucks` int(11) NULL DEFAULT NULL,
`viplvl` tinyint(4) NULL DEFAULT NULL,
`vipdate` datetime(0) NULL DEFAULT NULL,
`promocodes` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`present` tinyint(4) NULL DEFAULT 0,
`character1` int(11) NULL DEFAULT NULL,
Error SQL:
[ERR] 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 '(0) NULL DEFAULT NULL,
`promocodes` varchar(128) CHARACTER SET utf8 COLLATE u' at line 11
[ERR] /*
Отредактированно vadimkrivenkov (20.05.2020 15:21:57)
Неактивен
Приведите запрос на создание таблицы accouts полностью
Неактивен
вместо
`vipdate` datetime(0) NULL DEFAULT NULL,
должно быть
`vipdate` datetime NULL DEFAULT NULL,
Неактивен
vasya написал:
вместо
`vipdate` datetime(0) NULL DEFAULT NULL,
должно быть
`vipdate` datetime NULL DEFAULT NULL,
vasya,
Неактивен
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 '(0) NULL DEFAULT NULL,
`promocodes` varchar(128) CHARACTER SET utf8 COLLATE u' at line 11
В сообщении об ошибке 1064 в одинарных кавычках цитируется часть запроса с того места где начинается ошибка.
Результат запроса зависит от версии. Мне удалось воспроизвести ошибку на 5.0 (антиквариат ).
Неактивен
да, я на 5.7 запускал ))
В общем, ждём от топикстартера полный текст запроса на создание таблицы.
Но, конечно, datetime(0) в любом случае лучше заменить на datetime.
Неактивен
Просьба помочь выявить ошибку при импорте дампа в виде sql. Запрос следующий:
SET foreign_key_checks = 0;
CREATE TABLE `sklad` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`address_city` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`address_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_house` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_entrance` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_floor` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_office` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_comment` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_reliable` tinyint(1) DEFAULT NULL,
`address_full` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_short` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_plot` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address_building` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`courier_id` int(11) DEFAULT NULL,
`adopted_by_courier` tinyint(1) NOT NULL,
`adopted_by_courier_at` datetime DEFAULT NULL,
`courier_arrived_to_place_at` datetime DEFAULT NULL,
`courier_assigned_at` datetime DEFAULT NULL,
`arrived_to_customer_at` datetime DEFAULT NULL,
`taken_at` datetime DEFAULT NULL,
`moved_to_delivery_at` datetime DEFAULT NULL,
`delivered_at` datetime DEFAULT NULL,
`time_to_delivery` int(11) DEFAULT NULL,
`time_to_delivery_min` int(11) DEFAULT NULL,
`time_to_delivery_max` int(11) DEFAULT NULL,
`pre_delivery_time` int(11) NOT NULL,
`location_latitude` decimal(10,6) NOT NULL,
`location_longitude` decimal(10,6) NOT NULL,
`notify_priority` datetime NOT NULL,
`notify_priority_up_reason` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`operator_id` int(11) DEFAULT NULL,
`operator_assigned_at` datetime DEFAULT NULL,
`external_order_nr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`order_nr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`amount_blocked` int(11) NOT NULL DEFAULT '0',
`currency` char(3) COLLATE utf8_unicode_ci NOT NULL,
`amount_charged` int(11) NOT NULL DEFAULT '0',
`actual_amount` int(11) DEFAULT NULL,
`amount_client_paid` int(11) DEFAULT NULL,
`card_payment_failed_at` datetime DEFAULT NULL,
`payment_method_id` int(11) NOT NULL,
`payment_status` smallint(6) NOT NULL DEFAULT '0',
`payment_service` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`place_payment_method_id` int(11) NOT NULL,
`payture_card_id` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`payture_order_id` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`payture_session_id` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_id` int(11) NOT NULL,
`user_address_id` int(11) DEFAULT NULL,
`crm_comment` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`phone_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_agent` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL,
`change_on` int(11) DEFAULT NULL,
`persons_quantity` int(11) DEFAULT NULL,
`sort_priority` datetime NOT NULL,
`status` smallint(6) NOT NULL,
`is_asap` tinyint(1) NOT NULL,
`is_comment_transmitted` tinyint(1) NOT NULL DEFAULT '0',
`is_delayed` tinyint(1) NOT NULL DEFAULT '0',
`started_at` datetime DEFAULT NULL,
`call_center_confirmed_at` datetime DEFAULT NULL,
`cancelled_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`sent_to_restaurant_at` datetime DEFAULT NULL,
`place_confirmed_at` datetime DEFAULT NULL,
`reminded_call_at` datetime DEFAULT NULL,
`remind_at` datetime DEFAULT NULL,
`reminded_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`cancel_reason_id` int(11) DEFAULT NULL,
`cart_id` bigint(20) DEFAULT NULL,
`place_id` int(11) NOT NULL,
`feedback_id` int(11) DEFAULT NULL,
`logistic_approve_needed` tinyint(1) NOT NULL DEFAULT '0',
`available_delivery_delay` int(11) NOT NULL DEFAULT '0',
`place_call_requested_at` datetime DEFAULT NULL,
`type` enum('native','marketplace') COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:order_type)',
`processing_type` enum('native','marketplace','fast_food','store') COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '(DC2Type:order_processing_type)',
`region_id` int(11) unsigned DEFAULT NULL,
`place_commission` decimal(4,2) DEFAULT NULL,
`place_acquiring_commission` decimal(4,2) DEFAULT NULL,
`time_to_place` int(11) DEFAULT NULL,
`finished_at` datetime DEFAULT NULL,
`fully_payed` tinyint(1) NOT NULL DEFAULT '0',
`legal_info_id` int(11) DEFAULT NULL,
`latest_revision_id` int(10) unsigned DEFAULT NULL,
`app` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Идентификатор Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñ Ñ€ÐµÐºÐ²ÐµÑта',
`flow_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'native' COMMENT 'Order Flow identity',
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_E52FFDEE1AD5CDBF` (`cart_id`),
UNIQUE KEY `order_nr_idx` (`order_nr`),
UNIQUE KEY `UNIQ_E52FFDEE9E53D244` (`payture_order_id`),
UNIQUE KEY `UNIQ_E52FFDEED906FC5D` (`external_order_nr`),
UNIQUE KEY `UNIQ_E52FFDEED249A887` (`feedback_id`),
KEY `IDX_E52FFDEEA76ED395` (`user_id`),
KEY `IDX_E52FFDEEE3D8151C` (`courier_id`),
KEY `idx_created_at` (`created_at`),
KEY `IDX_E52FFDEE584598A3` (`operator_id`),
KEY `IDX_E52FFDEEEE1A430C` (`cancel_reason_id`),
KEY `idx_sort_priority` (`sort_priority`),
KEY `idx_notify_priority` (`notify_priority`),
KEY `IDX_E52FFDEE52D06999` (`user_address_id`),
KEY `IDX_E52FFDEE94A4C7D4` (`device_id`),
KEY `idx_payture_session_id` (`payture_session_id`),
KEY `idx_status_courier_delivered` (`status`,`courier_id`,`delivered_at`),
KEY `fk_orders_region` (`region_id`),
KEY `idx_place_confirmed_at` (`place_confirmed_at`),
KEY `idx_finished_at` (`finished_at`),
KEY `IDX_E52FFDEEDA6A219` (`place_id`),
KEY `IDX_E52FFDEE9AB05F96` (`legal_info_id`),
KEY `IDX_E52FFDEEC6556E3E` (`latest_revision_id`),
KEY `idx__orders__updated_at` (`updated_at`),
CONSTRAINT `FK_E52FFDEE52D06999` FOREIGN KEY (`user_address_id`) REFERENCES `user_addresses` (`id`) ON DELETE SET NULL,
CONSTRAINT `FK_E52FFDEE584598A3` FOREIGN KEY (`operator_id`) REFERENCES `admins` (`id`),
CONSTRAINT `FK_E52FFDEE94A4C7D4` FOREIGN KEY (`device_id`) REFERENCES `user_devices` (`id`) ON DELETE SET NULL,
CONSTRAINT `FK_E52FFDEEA76ED395` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `FK_E52FFDEEC6556E3E` FOREIGN KEY (`latest_revision_id`) REFERENCES `order_revisions` (`id`),
CONSTRAINT `FK_E52FFDEED249A887` FOREIGN KEY (`feedback_id`) REFERENCES `order_feedbacks` (`id`),
CONSTRAINT `FK_E52FFDEEDA6A219` FOREIGN KEY (`place_id`) REFERENCES `places` (`id`),
CONSTRAINT `FK_E52FFDEEE3D8151C` FOREIGN KEY (`courier_id`) REFERENCES `couriers` (`id`),
CONSTRAINT `FK_E52FFDEEEE1A430C` FOREIGN KEY (`cancel_reason_id`) REFERENCES `order_problem_dictionary` (`id`),
CONSTRAINT `__FK_E52FFDEE9AB05F96` FOREIGN KEY (`legal_info_id`) REFERENCES `legal_info` (`id`),
CONSTRAINT `fk_orders_region` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=687553028 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `orders` WRITE;
(492756953,'Склад','Подшипник','19','1','9',NULL,'Игольчатый',1,NULL,NULL,NULL,NULL,1918424,1,'2021-06-19 14:36:24','2021-06-19 14:46:51','2021-06-19 14:36:24','2021-06-19 15:08:45','2021-06-19 15:00:34','2021-06-19 14:46:51','2021-06-19 15:11:09',18,25,35,32,47.284140,39.720074,'2021-06-19 14:20:25',NULL,NULL,NULL,'72ad6d14-d6df-4eb2-a412-cb754ebfcc52','210619-415593',0,'RUB',514,NULL,514,NULL,1,2,'EatsPayments',2,NULL,NULL,NULL,2759306,'833799781',6527186,NULL,'Игорь',NULL,NULL,NULL,1,'2021-06-19 14:20:25',4,1,1,0,'2021-06-19 14:20:26','2021-06-19 14:20:25',NULL,'2021-06-19 14:20:04',NULL,'2021-06-19 14:39:27','2021-06-19 14:39:27',NULL,'2021-06-19 14:39:25','2021-06-19 14:39:27','2021-06-19 15:11:10',NULL,1021922418,40759,NULL,489887268,NULL,NULL,0,-10,NULL,'native','fast_food',NULL,25,NULL,NULL,1,230590,'2021-06-19 15:11:09',1,2,NULL,'474a87fa82f6bcd3fcd384f589962f20',NULL);
Сообщение об ошибке:
(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 '492756953,'Склад','Подшипник'... at line 1
Импортирую через HeidiSQL. Через консоль - та же ошибка
Неактивен
После
LOCK TABLES `orders` WRITE;
явно должно идти
insert into orders(...перечень полей) values
и лишь далее
(492756953,'Склад',....
есть сильное ощущение, что дамп испорчен
Неактивен