0

I am using migration toolkit for the migration but i am getting these errors in the process of migration

  1. Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
  2. Incorrect string value: '\xEF\xBF\xBDs d...' for column 'MESSAGE' at row 5 0 row(s) transferred.

For the fixing the first error i got something here http://terrencemiao.com/Webmail/msg00949.html

but i am not getting the second error what it is and why is it there how to fix it also suggest me some better ideas for fixing the first one if there any apart from what mentioned in the link

    USE `MyDB`
Creating tables ...

Creating table MyTable...
DROP TABLE IF EXISTS `MyTable`
Creating table MyTable ...
SET NAMES UTF8;

CREATE TABLE `MyTable` (
  `PrimaryKey` INT(10) NOT NULL AUTO_INCREMENT,
  `FK_QUESTION_ID` INT(10) NOT NULL,
  `ANSWER` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL
  PRIMARY KEY (`PK_ID`)
)
ENGINE = INNODB

i am getting error for answer column

2
  • Show code lines for that errors.
    – Devart
    Mar 25, 2011 at 13:22
  • i have updated the question can you please take a look and tell me i have tried 'SET NAMES UTF8;'but still getting the same error
    – Mac
    Mar 25, 2011 at 13:39

1 Answer 1

2

*Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause* This is right, you should not create more then one such fields.

Incorrect string value: '\xEF\xBF\xBDs d...' for column 'MESSAGE' at row 5 0 row(s) transferred. Possible encoding error, try to run 'SET NAMES UTF8;' before inserting data


Try this statement,

CREATE TABLE `MyTable` (
  PK_ID INT(11) NOT NULL AUTO_INCREMENT,
  FK_QUESTION_ID INT(11) NOT NULL,
  ANSWER LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  PRIMARY KEY (`PK_ID`)
)
ENGINE = INNODB;

You missed a comma and it was wrong field name. Be careful with migration toolkit. Check generated field types, for example if you do not need 4GB text values, you could use simple VARCHAR instead of LONGTEXT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.