mysql error 1064 when changing structure of date from datetime to VARCHAR

There is an issue when I try to change the structure of one of the table in mysql It is user db table and it has many fields and one of them is register date field

It is currently set to datetime and I am trying to change it to VARCHAR using phpmyAdmin as that is the only best way I know to do it using my limited mysql / phpmyadmin expertise.

ALTER TABLE  abnhd_user CHANGE  registerDate  registerDate VARCHAR NOT NULL DEFAULT '0000-00-00 00:00:00'

when I try to change it from datetime to VARCHAR, I get following error

#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 'NOT NULL DEFAULT '0000-00-00 00:00:00'' at line 1

Answers


You executed query

ALTER TABLE  abnhd_user CHANGE  registerDate  registerDate VARCHAR NOT NULL DEFAULT '0000-00-00 00:00:00'

But MySQL doesn't have default value '0000-00-00 00:00:00' for VARCHAR so use below SQL to change to VARCHAR

ALTER TABLE abnhd_user MODIFY registerDate VARCHAR(30);

Need Your Help

Facebook video upload via Graph API Javascript SDK

php javascript facebook facebook-graph-api

is it possible to upload a video to Facebook via the Graph API, using the Javascript SDK?

Android: debug shared library

android debugging android-ndk gdb

I'd like to debug android NDK application, more precisely - I want to check what arguments (r4 - r8 r1 - r4 registers) are passed to function from shared library in apk.