我正在使用MySQL。 我通过phpMyAdmin将我的db表导出到sql文件。 我通过phpMyAdmin在本地导入该文件没有问题,但是当我尝试将其导入ClearDB MySQL时,我收到以下错误:
第29行的错误1064(42000):您的SQL语法出错; 检查与您的MySQL服务器版本对应的手册 正确的语法在'(6)NOT NULL DEFAULT CURRENT_TIMESTAMP(6)附近使用,
cId
int(11)DEFAULT NULL)第4行的引擎'
这是SQL:
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 06, 2017 at 10:39 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
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 utf8mb4 */;
--
-- Database: `repro`
--
-- --------------------------------------------------------
--
-- Table structure for table `a`
--
CREATE TABLE `a` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `b`
--
CREATE TABLE `b` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`is` int(11) NOT NULL,
`v2` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`v3` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `c`
--
CREATE TABLE `c` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` varchar(255) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` varchar(255) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` varchar(255) NOT NULL,
`v7` int(11) NOT NULL,
`v8` int(11) NOT NULL,
`v9` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`dId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `d`
--
CREATE TABLE `d` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` int(11) NOT NULL,
`v6` int(11) NOT NULL,
`v7` int(11) NOT NULL,
`v8` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `e`
--
CREATE TABLE `e` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` int(11) NOT NULL,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `f`
--
CREATE TABLE `f` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g`
--
CREATE TABLE `g` (
`id` int(11) NOT NULL,
`c_g_id` int(11) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` int(11) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` int(11) NOT NULL,
`v7` int(11) NOT NULL,
`v8` tinyint(4) NOT NULL,
`v9` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `h`
--
CREATE TABLE `h` (
`id` int(11) NOT NULL,
`v10` text NOT NULL,
`v11` text NOT NULL,
`v12` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL,
`kId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `i`
--
CREATE TABLE `i` (
`id` int(11) NOT NULL,
`v13` varchar(255) NOT NULL,
`v14` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`v15` varchar(255) NOT NULL,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `j`
--
CREATE TABLE `j` (
`id` int(11) NOT NULL,
`v16` varchar(255) NOT NULL,
`v17` varchar(255) NOT NULL,
`v18` int(11) NOT NULL,
`v19` varchar(255) NOT NULL,
`v20` int(11) NOT NULL,
`v21` int(11) NOT NULL,
`last_activity` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`date` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`fId` int(11) DEFAULT NULL,
`gId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `k`
--
CREATE TABLE `k` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` varchar(255) NOT NULL,
`v7` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`jId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`iId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `l`
--
CREATE TABLE `l` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` varchar(255) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `a`
--
ALTER TABLE `a`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_1e8337240143dcb523962f54c5f` (`cId`);
--
-- Indexes for table `b`
--
ALTER TABLE `b`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_5cac5f64c02f625546708887642` (`cId`);
--
-- Indexes for table `c`
--
ALTER TABLE `c`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_ec5caf1853f876085f6977a042b` (`dId`);
--
-- Indexes for table `d`
--
ALTER TABLE `d`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `e`
--
ALTER TABLE `e`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_a02b2b9446741ac1d591d286507` (`jId`),
ADD KEY `fk_d7f5f5872631eba4c37b2de5714` (`fId`),
ADD KEY `fk_a951d4354f5f44bc2b548e979e2` (`cId`);
--
-- Indexes for table `f`
--
ALTER TABLE `f`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `g`
--
ALTER TABLE `g`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_98a6a31288ef0611a4281f8f668` (`cId`);
--
-- Indexes for table `h`
--
ALTER TABLE `h`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_266acd73ddba66293083c974056` (`jId`),
ADD KEY `fk_e86962992225e0f868acdb3dea2` (`fId`),
ADD KEY `fk_ff9eacd300026082e7448badeb0` (`cId`),
ADD KEY `fk_91e06a0a4cc1ccad997742ebbd9` (`kId`);
--
-- Indexes for table `i`
--
ALTER TABLE `i`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_a4d7e49f417025c79fa0f5e46e0` (`jId`),
ADD KEY `fk_080397f56230d7ef8fa7abe9a96` (`fId`),
ADD KEY `fk_dfdbe5502a5ecc6a13c6216586c` (`cId`);
--
-- Indexes for table `j`
--
ALTER TABLE `j`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_0fa8bd5e1970550231a6dbf48f9` (`fId`),
ADD KEY `fk_cd79170a5dddf791a53e9c4ce30` (`gId`),
ADD KEY `fk_8b585eb0f2626cce64cacf47203` (`cId`);
--
-- Indexes for table `k`
--
ALTER TABLE `k`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_f7ffaabf651b77f45d97c6c016d` (`jId`),
ADD KEY `fk_ac085218a218c0c95feb3ccced5` (`cId`),
ADD KEY `fk_f4b2c776c5615151c3d31cfd3f7` (`fId`),
ADD KEY `fk_08bc80ed5a66c15c042a38bcbd0` (`iId`);
--
-- Indexes for table `l`
--
ALTER TABLE `l`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_4c1a4e27ee2b331ad2cacae0dcb` (`jId`),
ADD KEY `fk_f3a091a7e4c54ff96d394c207be` (`fId`),
ADD KEY `fk_f9785f8f284daf9e101b6cf298d` (`cId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `a`
--
ALTER TABLE `a`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `b`
--
ALTER TABLE `b`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `c`
--
ALTER TABLE `c`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `d`
--
ALTER TABLE `d`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `e`
--
ALTER TABLE `e`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `f`
--
ALTER TABLE `f`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `g`
--
ALTER TABLE `g`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `h`
--
ALTER TABLE `h`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `i`
--
ALTER TABLE `i`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `j`
--
ALTER TABLE `j`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `k`
--
ALTER TABLE `k`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `l`
--
ALTER TABLE `l`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `a`
--
ALTER TABLE `a`
ADD CONSTRAINT `fk_1e8337240143dcb523962f54c5f` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `b`
--
ALTER TABLE `b`
ADD CONSTRAINT `fk_5cac5f64c02f625546708887642` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `c`
--
ALTER TABLE `c`
ADD CONSTRAINT `fk_ec5caf1853f876085f6977a042b` FOREIGN KEY (`dId`) REFERENCES `d` (`id`);
--
-- Constraints for table `e`
--
ALTER TABLE `e`
ADD CONSTRAINT `fk_a02b2b9446741ac1d591d286507` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_a951d4354f5f44bc2b548e979e2` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_d7f5f5872631eba4c37b2de5714` FOREIGN KEY (`fId`) REFERENCES `f` (`id`);
--
-- Constraints for table `g`
--
ALTER TABLE `g`
ADD CONSTRAINT `fk_98a6a31288ef0611a4281f8f668` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `h`
--
ALTER TABLE `h`
ADD CONSTRAINT `fk_266acd73ddba66293083c974056` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_91e06a0a4cc1ccad997742ebbd9` FOREIGN KEY (`kId`) REFERENCES `k` (`id`),
ADD CONSTRAINT `fk_e86962992225e0f868acdb3dea2` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_ff9eacd300026082e7448badeb0` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `i`
--
ALTER TABLE `i`
ADD CONSTRAINT `fk_080397f56230d7ef8fa7abe9a96` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_a4d7e49f417025c79fa0f5e46e0` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_dfdbe5502a5ecc6a13c6216586c` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `j`
--
ALTER TABLE `j`
ADD CONSTRAINT `fk_0fa8bd5e1970550231a6dbf48f9` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_8b585eb0f2626cce64cacf47203` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_cd79170a5dddf791a53e9c4ce30` FOREIGN KEY (`gId`) REFERENCES `g` (`id`);
--
-- Constraints for table `k`
--
ALTER TABLE `k`
ADD CONSTRAINT `fk_08bc80ed5a66c15c042a38bcbd0` FOREIGN KEY (`iId`) REFERENCES `i` (`id`),
ADD CONSTRAINT `fk_ac085218a218c0c95feb3ccced5` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_f4b2c776c5615151c3d31cfd3f7` FOREIGN KEY (`fId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_f7ffaabf651b77f45d97c6c016d` FOREIGN KEY (`jId`) REFERENCES `j` (`id`);
--
-- Constraints for table `l`
--
ALTER TABLE `l`
ADD CONSTRAINT `fk_4c1a4e27ee2b331ad2cacae0dcb` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_f3a091a7e4c54ff96d394c207be` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_f9785f8f284daf9e101b6cf298d` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
/*!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 */;
这是删除datetime变量长度后修改的SQL:
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 06, 2017 at 10:39 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
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 utf8mb4 */;
--
-- Database: `repro`
--
-- --------------------------------------------------------
--
-- Table structure for table `a`
--
CREATE TABLE `a` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `b`
--
CREATE TABLE `b` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`is` int(11) NOT NULL,
`v2` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`v3` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `c`
--
CREATE TABLE `c` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` varchar(255) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` varchar(255) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` varchar(255) NOT NULL,
`v7` int(11) NOT NULL,
`v8` int(11) NOT NULL,
`v9` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`dId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `d`
--
CREATE TABLE `d` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` int(11) NOT NULL,
`v6` int(11) NOT NULL,
`v7` int(11) NOT NULL,
`v8` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `e`
--
CREATE TABLE `e` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` int(11) NOT NULL,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `f`
--
CREATE TABLE `f` (
`id` int(11) NOT NULL,
`v1` varchar(255) NOT NULL,
`v2` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g`
--
CREATE TABLE `g` (
`id` int(11) NOT NULL,
`c_g_id` int(11) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` int(11) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` int(11) NOT NULL,
`v7` int(11) NOT NULL,
`v8` tinyint(4) NOT NULL,
`v9` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `h`
--
CREATE TABLE `h` (
`id` int(11) NOT NULL,
`v10` text NOT NULL,
`v11` text NOT NULL,
`v12` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL,
`kId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `i`
--
CREATE TABLE `i` (
`id` int(11) NOT NULL,
`v13` varchar(255) NOT NULL,
`v14` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`v15` varchar(255) NOT NULL,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `j`
--
CREATE TABLE `j` (
`id` int(11) NOT NULL,
`v16` varchar(255) NOT NULL,
`v17` varchar(255) NOT NULL,
`v18` int(11) NOT NULL,
`v19` varchar(255) NOT NULL,
`v20` int(11) NOT NULL,
`v21` int(11) NOT NULL,
`last_activity` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fId` int(11) DEFAULT NULL,
`gId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `k`
--
CREATE TABLE `k` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` int(11) NOT NULL,
`v3` int(11) NOT NULL,
`v4` int(11) NOT NULL,
`v5` varchar(255) NOT NULL,
`v6` varchar(255) NOT NULL,
`v7` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`jId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`iId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `l`
--
CREATE TABLE `l` (
`id` int(11) NOT NULL,
`v1` int(11) NOT NULL,
`v2` varchar(255) NOT NULL,
`v3` varchar(255) NOT NULL,
`v4` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`jId` int(11) DEFAULT NULL,
`fId` int(11) DEFAULT NULL,
`cId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `a`
--
ALTER TABLE `a`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_1e8337240143dcb523962f54c5f` (`cId`);
--
-- Indexes for table `b`
--
ALTER TABLE `b`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_5cac5f64c02f625546708887642` (`cId`);
--
-- Indexes for table `c`
--
ALTER TABLE `c`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_ec5caf1853f876085f6977a042b` (`dId`);
--
-- Indexes for table `d`
--
ALTER TABLE `d`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `e`
--
ALTER TABLE `e`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_a02b2b9446741ac1d591d286507` (`jId`),
ADD KEY `fk_d7f5f5872631eba4c37b2de5714` (`fId`),
ADD KEY `fk_a951d4354f5f44bc2b548e979e2` (`cId`);
--
-- Indexes for table `f`
--
ALTER TABLE `f`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `g`
--
ALTER TABLE `g`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_98a6a31288ef0611a4281f8f668` (`cId`);
--
-- Indexes for table `h`
--
ALTER TABLE `h`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_266acd73ddba66293083c974056` (`jId`),
ADD KEY `fk_e86962992225e0f868acdb3dea2` (`fId`),
ADD KEY `fk_ff9eacd300026082e7448badeb0` (`cId`),
ADD KEY `fk_91e06a0a4cc1ccad997742ebbd9` (`kId`);
--
-- Indexes for table `i`
--
ALTER TABLE `i`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_a4d7e49f417025c79fa0f5e46e0` (`jId`),
ADD KEY `fk_080397f56230d7ef8fa7abe9a96` (`fId`),
ADD KEY `fk_dfdbe5502a5ecc6a13c6216586c` (`cId`);
--
-- Indexes for table `j`
--
ALTER TABLE `j`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_0fa8bd5e1970550231a6dbf48f9` (`fId`),
ADD KEY `fk_cd79170a5dddf791a53e9c4ce30` (`gId`),
ADD KEY `fk_8b585eb0f2626cce64cacf47203` (`cId`);
--
-- Indexes for table `k`
--
ALTER TABLE `k`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_f7ffaabf651b77f45d97c6c016d` (`jId`),
ADD KEY `fk_ac085218a218c0c95feb3ccced5` (`cId`),
ADD KEY `fk_f4b2c776c5615151c3d31cfd3f7` (`fId`),
ADD KEY `fk_08bc80ed5a66c15c042a38bcbd0` (`iId`);
--
-- Indexes for table `l`
--
ALTER TABLE `l`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_4c1a4e27ee2b331ad2cacae0dcb` (`jId`),
ADD KEY `fk_f3a091a7e4c54ff96d394c207be` (`fId`),
ADD KEY `fk_f9785f8f284daf9e101b6cf298d` (`cId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `a`
--
ALTER TABLE `a`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `b`
--
ALTER TABLE `b`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `c`
--
ALTER TABLE `c`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `d`
--
ALTER TABLE `d`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `e`
--
ALTER TABLE `e`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `f`
--
ALTER TABLE `f`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `g`
--
ALTER TABLE `g`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `h`
--
ALTER TABLE `h`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `i`
--
ALTER TABLE `i`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `j`
--
ALTER TABLE `j`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `k`
--
ALTER TABLE `k`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `l`
--
ALTER TABLE `l`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `a`
--
ALTER TABLE `a`
ADD CONSTRAINT `fk_1e8337240143dcb523962f54c5f` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `b`
--
ALTER TABLE `b`
ADD CONSTRAINT `fk_5cac5f64c02f625546708887642` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `c`
--
ALTER TABLE `c`
ADD CONSTRAINT `fk_ec5caf1853f876085f6977a042b` FOREIGN KEY (`dId`) REFERENCES `d` (`id`);
--
-- Constraints for table `e`
--
ALTER TABLE `e`
ADD CONSTRAINT `fk_a02b2b9446741ac1d591d286507` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_a951d4354f5f44bc2b548e979e2` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_d7f5f5872631eba4c37b2de5714` FOREIGN KEY (`fId`) REFERENCES `f` (`id`);
--
-- Constraints for table `g`
--
ALTER TABLE `g`
ADD CONSTRAINT `fk_98a6a31288ef0611a4281f8f668` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `h`
--
ALTER TABLE `h`
ADD CONSTRAINT `fk_266acd73ddba66293083c974056` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_91e06a0a4cc1ccad997742ebbd9` FOREIGN KEY (`kId`) REFERENCES `k` (`id`),
ADD CONSTRAINT `fk_e86962992225e0f868acdb3dea2` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_ff9eacd300026082e7448badeb0` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `i`
--
ALTER TABLE `i`
ADD CONSTRAINT `fk_080397f56230d7ef8fa7abe9a96` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_a4d7e49f417025c79fa0f5e46e0` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_dfdbe5502a5ecc6a13c6216586c` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
--
-- Constraints for table `j`
--
ALTER TABLE `j`
ADD CONSTRAINT `fk_0fa8bd5e1970550231a6dbf48f9` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_8b585eb0f2626cce64cacf47203` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_cd79170a5dddf791a53e9c4ce30` FOREIGN KEY (`gId`) REFERENCES `g` (`id`);
--
-- Constraints for table `k`
--
ALTER TABLE `k`
ADD CONSTRAINT `fk_08bc80ed5a66c15c042a38bcbd0` FOREIGN KEY (`iId`) REFERENCES `i` (`id`),
ADD CONSTRAINT `fk_ac085218a218c0c95feb3ccced5` FOREIGN KEY (`cId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_f4b2c776c5615151c3d31cfd3f7` FOREIGN KEY (`fId`) REFERENCES `c` (`id`),
ADD CONSTRAINT `fk_f7ffaabf651b77f45d97c6c016d` FOREIGN KEY (`jId`) REFERENCES `j` (`id`);
--
-- Constraints for table `l`
--
ALTER TABLE `l`
ADD CONSTRAINT `fk_4c1a4e27ee2b331ad2cacae0dcb` FOREIGN KEY (`jId`) REFERENCES `j` (`id`),
ADD CONSTRAINT `fk_f3a091a7e4c54ff96d394c207be` FOREIGN KEY (`fId`) REFERENCES `f` (`id`),
ADD CONSTRAINT `fk_f9785f8f284daf9e101b6cf298d` FOREIGN KEY (`cId`) REFERENCES `c` (`id`);
/*!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 */;
答案 0 :(得分:0)
数据类型datetime
没有可变长度。请删除(6)
`v2` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
答案 1 :(得分:0)
在讨论了ClearDB支持的问题之后:
问题是相关的ClearDB集群运行mysql 5.5,而对于mysql 5.6.5及以下版本,则适用:
“CURRENT_TIMESTAMP仅在TIMESTAMP字段上可接受.DATETIME字段必须保留为空的默认值,或者根本没有默认值 - 默认值必须是常量值,而不是表达式的结果。”