Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home Problem Issue Error MySQL Incorrect Data Type Value In Column

MySQL Incorrect Data Type Value In Column

I got a lot of error messages: “incorrect datetime value in column …”, “incorrect string value in column …” and “incorrect integer value in column …” when I migrate my web application from the staging server to production server.

To solve the issue, you may need to validate all your data before passing to your MySQL database to make sure they match with your predefined data type. Or if you have a root access to the server, follow these steps:

  • 1. Open the MySQL configuration file (my.ini in Windows or my.cnf in Linux). Please create a backup for it as always.
  • 2. Disable the line:
    sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION” by removing it or adding a # at the beginning of the line like this:

    [text] # Set the SQL mode to strict
    #sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    [/text]
  • 3. Restart the MySQL server

Note: you can find the MySQL configuration file by using command in Linux:

[text] whereis my.cnf
[/text]

Or if you’re on Windows Server, it could be:

+ C:\Program Files\MySQL\MySQL Server 5.0\bin
+ C:\xampp\mysql\bin

Aug 19, 2011Hoan Huynh
Check cross difference browsers and operating systems (platform) for QC processHow To Enable Telnet Command In Windows 7 And Server 2008
You Might Also Like:
  • Where MySQL Data Dir And Innodb Data Home Dir Location
  • Replace String With NText Or Text Data Type In MS SQL Server
  • Install LAMP (Apache, MySQL and PHP in Linux) on CentOS
  • Change or reset MySQL Root Account Password
  • Tips For Tuning And Optimizing Mysql On Low Memory Dedicated Server Or VPS
  • PHP Connect To MySQL Read Data And Export XML Format
  • Replace String In MySQL
  • Export/Import Data From Local Database To Remote Database With MS SQL Server 2008
  • Schedule Backup And Zip MySQL Database In Windows
  • Add Mime Type (.FLV, MP4) To Web.Config In IIS 7
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

10 years ago Problem Issue Errormy.cnf, STRICT_TRANS_TABLES153
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
24,459 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
21,836 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
17,654 views
JQuery Allow only numeric characters or only alphabet characters in textbox
14,988 views
C# Read Json From URL And Parse/Deserialize Json
11,721 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Things to Learn about Installingderm Loan Type S
  • Online Photo Editor – Free Photoediting Software
  • A Guide to Finding the Best Paper Sellers
  • Photoediting in Home Isn’t Hard to Do!

  • Free Photo Editor Online
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (27)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (647)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development