toggle menu

Moved project to Digital Ocean LEMP server , getting database error

Manas Mayank |03 Apr at 11:04

I have uploaded my project Digital Ocean LEMP and getting issue with 

1. Datatype datetime - 0000-00-00 00:00:00 is not valid date type

2. Datatype Integer - Incorrect integer value for column name at row 1

3. Datatype Float - Data truncated for column for column name at row 1

Basically these error were coming at insert and update time, as proper datatype was not coming from php end.

I cannot change php end as project is live.

How to dissolve these issues. thanks in advance

  • 1 like
  • 2 comments

Dhananjay Kumar03 Apr at 12:04

I am getting the same issues & i have updated MySQL settings and its work fine for me.

You go in a file : /etc/mysql/mysql.conf.d/mysqld.cnf
and add below script at end of line
sql_mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

After adding restart your MySQL: sudo service mysql restart

Please try, its really work.


Manas Mayank03 Apr at 12:04

Thats works for me. Thanks

Posted:

03 Apr at 11:04

Viewed:

1050 times

Active:

06 Apr at 10:04