Limit setting on entering data in mysql

Asked

Viewed 104 times

-2

Looks for a specific configuration in mysql database, formerly had a server with mysql installed (not by me), when I performed a query of Insert/update that had a content above the allowed it cut the content to the limit set in the table configuration, for example. If I try to insert '1234567890' in a field that the limit is 5 characters, instead of returning me the error 'Data Too long for column' it cuts the content to the limit of the capo in this case '12345'. I migrated from server and it does not have this configuration, it returns me the error above, which configuration should perform, the server is a Centos

1 answer

1


In the archive my.ini should be as STRICT, in sql-mode:

Disable yourself by configuring sql-mode will be permissive, despite recommending that you adjust this in the application, I mean, setting for the user to know that he has passed the data limit, validate the data entries, because actually cutting a text or entering an invalid date can be a problem.

  • Thanks was the name of the configuration, in my case I had to remove in the file /etc/mysql/my.cnf Putting the following line in the file sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION without the option STRICT_ALL_TABLES

Browser other questions tagged

You are not signed in. Login or sign up in order to post.