Mysql运行SQL文件 错误Incorrect table definition;there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
问题描述
想从服务器上DOWN下数据库。操作:先把数据库转存为SQL文件,然后在本地利用navicate运行SQL文件,出现错误信息:
Incorrect table definition;there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
解决思路
参考:
http://www.cnblogs.com/joeylee/p/3877578.html
原因:TIMESTAMP中,低版本中不支持一个表中有两个TIMESTAMP字段。
解决方案:
1、select version(); 查看服务器上用的哪个SQL版本。 同步到本地。
2、卸载Mysql (原来已安装mysql 5.5 --->mysql 5.6)
I.利用安装与卸载应用程序卸载mysql。(需要关机重启)
II.cmd->services.msc 打开服务,看到MySQL服务名还在。
cmd->sc delete MySQL(要删除的服务名)
3、安装mysql
I.下载mysql 5.6 -64x.zip,解压后放到对应位置**。 下载位置:http://pan.baidu.com/s/1kVvYtIf
II.配置PATH环境变量
**/bin 配置到PATH
在**路径下找到my_default.ini或者新建一个my.ini
输入或更改
[mydqld]
basedir = **
datadir= **\data
4、启动mysql
I.cmd->cd **\bin ->mysqld --install
II.成功后继续输入 net start mysql
5、登录mysql
I.cmd->cd **\bin->mysql -u root -p
II.首次登录没有密码 直接登录成功
III.修改root的密码
use mysql;
update user set password=password("new_pass") where user="root";
flush privileges;
exit;
6、想要修改已经存在root密码
I.my.ini中加入(如果没有,可以在my_default.ini中)
[mysqld]
#跳过密码验证
#skip-name-resolve
II.然后在cmd中直接输入mysql -uroot 就可以直接登录 执行上一步的第三项就可以了
7、登录成功后,再次执行同步后就不出现问题了.
Mysql运行SQL文件 错误Incorrect table definition;there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause的更多相关文章
- Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
错误描述 在DBeaver执行DDL语句时报错:SQL 错误 [1293] [HY000]: Incorrect table definition; there can be only one TIM ...
- 1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
在数据库执行脚本文件时,执行到一半会遇到 这种问题: 出错处:2018-05-14 18:53:38 行号:712454 错误代码: 1293 - Incorrect table definitio ...
- msyql同步的时候报错 : 错误代码: 1293 Incorrect table definition;there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
场景,两个不同服务器上的数据库,进行数据库同步 但是执行之后,提示报错 错误代码: 1293 Incorrect table definition; there can be only one TIM ...
- mysql单表多timestamp报错#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
一个表中出现多个timestamp并设置其中一个为current_timestamp的时候经常会遇到#1293 - Incorrect table definition; there can be o ...
- Mysql --- Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
我使用的5.5的mysql数据库会报这个错, 换成5.7的就可以了
- MySQL there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause同时创建多个更新当前时间戳字段 解决方法
问题重现 在写这篇文章之前,明确我的MySQL版本,MariaDB 或者你使用 MySQL 8 也会出现如下问题 MySQL 版本 现在有这样的需求,一张表中有一个字段created_at记录创建该条 ...
- Mysql [Err] 1293 there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
问题: mysql数据 导入数据出错 [Err] 1293 - Incorrect table definition; there can be only one TIMESTAMP column w ...
- mysql5.7 timestamp错误:there can be only oneTIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE
#1293 - Incorrect table definition; there can be only oneTIMESTAMP column with CURRENT_TIMESTAMP in ...
- mysql:[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
删除主键时,出错:[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be d ...
随机推荐
- swift 之 闭包
一.闭包 格式:{ ( 参数名:类型, 参数名:类型 .. ) in 内容体 return 返回值 } 最完整的闭包 1.省略参数类型 { ( 参数名, 参数名.. ) ...
- table边框单线的实现方法
1.实现方法一: <table border="0" cellspacing="1" style=" 实现原理:利用table的单元 ...
- Mapped Statements collection does not contain value fo
Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...
- js闭包使用
闭包就是在一个函数内定义一个内部函数 并返回内部函数 function f1(){ var a=1; add=function(){a=a+1;} function f1Sub(){ console. ...
- MAC 安装j2ee.sh的办法
It says it needs the DISPLAY variable set - what do I need to set it to? Instead of saying: ./java_e ...
- LINUX 命令定期执行可执行文件
linux命令将nodejs文件变成可执行文件 在linux中一般我们在运行node文件时用的命令为: node example.js 首先.删除文件后缀,在linux命令下添加可执行权限 mv ex ...
- H5学习系列之Audio和Video
1.视频文件:音频轨道.视频轨道和一些元数据(视频封面.标题.子标题.字幕等相关信息). 2.目前H5还不支持的:流式音频和视频(H5对视频的支持只限于加载的全部媒体文件).H5的媒体收到跨域资源共享 ...
- JAVA可移植性广泛应用
一.JAVA作为一种编程语言:源代码可移植性 作为一种编程语言,JAVA提供了一种最简单同时也是人们最熟悉的可移植性–源代码移植.这意味着任意一个JAVA程序,不论它运行在何种CPU.操作系统或JAV ...
- POJ2632
#include<stdio.h> #include<string.h> #include<algorithm> #include<cmath> usi ...
- C++写一个带参数运行的程序
#include <string.h>#include <iostream>#include <cstdlib>using namespace std; int m ...