-------------- SHOW VARIABLES LIKE "%CHAR%" -------------- +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.11 sec) -------------- CREATE DATABASE IF NOT EXISTS test -------------- Query OK, 1 row affected, 1 warning (0.00 sec) Note (Code 1007): Can't create database 'test'; database exists -------------- CREATE OR REPLACE TABLE table_coupon_defaulttime ( coupon_no varchar(10) NOT NULL DEFAULT '', memo varchar(30) DEFAULT NULL, discount double DEFAULT NULL, KAISHI_BI datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (coupon_no) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 -------------- Query OK, 0 rows affected (0.72 sec) -------------- INSERT INTO table_coupon_defaulttime VALUES ('1','ABC',250,'2014-01-01 12:00'),('2','DE F',200,'2014-05-01 08:00'),('3','GHI',300,NULL) -------------- Query OK, 3 rows affected, 1 warning (0.00 sec) Records: 3 Duplicates: 0 Warnings: 1 Warning (Code 1048): Column 'KAISHI_BI' cannot be null -------------- SELECT * FROM table_coupon_defaulttime -------------- +-----------+------------+----------+---------------------+ | coupon_no | memo | discount | KAISHI_BI | +-----------+------------+----------+---------------------+ | 1 | ABC | 250 | 2014-01-01 12:00:00 | | 2 | DE F | 200 | 2014-05-01 08:00:00 | | 3 | GHI | 300 | 0000-00-00 00:00:00 | +-----------+------------+----------+---------------------+ 3 rows in set (0.00 sec) -------------- CREATE OR REPLACE TABLE table_coupon_nodefaulttime ( coupon_no varchar(10) NOT NULL DEFAULT '', memo varchar(30) DEFAULT NULL, discount double DEFAULT NULL, KAISHI_BI datetime NOT NULL, PRIMARY KEY (coupon_no) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 -------------- Query OK, 0 rows affected (0.18 sec) -------------- INSERT INTO table_coupon_nodefaulttime VALUES ('1','ABC',250,'2014-01-01 12:00'),('2','DE F',200,'2014-05-01 08:00'),('3','GHI',300,NULL) -------------- Query OK, 3 rows affected, 1 warning (0.00 sec) Records: 3 Duplicates: 0 Warnings: 1 Warning (Code 1048): Column 'KAISHI_BI' cannot be null -------------- SELECT * FROM table_coupon_nodefaulttime -------------- +-----------+------------+----------+---------------------+ | coupon_no | memo | discount | KAISHI_BI | +-----------+------------+----------+---------------------+ | 1 | ABC | 250 | 2014-01-01 12:00:00 | | 2 | DE F | 200 | 2014-05-01 08:00:00 | | 3 | GHI | 300 | 0000-00-00 00:00:00 | +-----------+------------+----------+---------------------+ 3 rows in set (0.00 sec) -------------- GRANT ALL ON test.* TO 'root'@'10.0.1.33' -------------- Query OK, 0 rows affected (0.07 sec) Bye