MySQL default values must be overriden

Problem

We have observed a serious issue that can occur when using the default MySQL configuration (Linux and Windows).

Note: There are also some additional MySQL issues that may require fixes. See Introduction To The Database for more.

Solution

Before creating the schema you must override the MySQL defaults.

In MySQL Workbench run the query below to check if the problem exists in your system:

show variables like 'sql_mode';

Then check the output. If the sql-mode variable contains either or both of the two entries NO_ZERO_IN_DATE,NO_ZERO_DATE then perform the steps below. (If neither of these two entries is present in the variable then carry on with creating the schema.)

Example of problem code:

sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

On Linux: To fix the problem open the my.cnf file in /etc/mysql for editing and cut the two entries:

NO_ZERO_IN_DATE,NO_ZERO_DATE

Also ensure that the command [mysqld] which runs the MySQL server daemon is present. The picture below is an example of what the line might look like after editing.

configuring-different-database

On Windows: To fix the problem open the my-default.ini file in C:\Program Files\MySQL\MySQL Server (version#) then cut the entries NO_ZERO_IN_DATE,NO_ZERO_DATE and save the file.

MySQL Preconditions -- Warning!

  • deploycloud
  • deployonprem

results matching ""

    No results matching ""