Online Chat
 Call Us: 
1-877-744-1221
Browse Ask a Question
 
Tools
Rss Categories

SQLSTATE[HY000] error when I setup database

Author: Edward Hardin Reference Number: AA-00289 Last Updated: 08/16/2011 05:14 PM 0 Rating/ Voters

On the database setup installation step you may get following error:

An error while SQL execution:SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE2\x80\xB3x11...' for column 'answer' at row 1...



This error is caused by MySQL server option:

sql-mode="STRICT_TRANS_TABLES"

This option have to be disabled. You can find it in the my.ini configuration file.

Here are several examples for where you can find the my.ini:

Separate installation of MySQL:

C:\Program Files\MySQL\MySQL Server 5.1\

C:\Program Files (x86)\MySQL\MySQL Server 5.1\my.ini

WAMP:

C:\wamp\bin\mysql\mysql5.1.*\

XAMMP:

C:\xampp\mysql\bin\


By default the sql-mode mode looks like this:

sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES"

In order to resolve this issue, remove STRICT_TRANS_TABLES option, save the file, and restart the MySQL server.