MySQL-- error and solutions

MySQL-- error and solutions

Abstract: This paper records the problems encountered in the process as well as the use of MySQL solutions.

Timestamp data type defined

Related Blog

1 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

Solution

Join in the configuration file:

1 [mysqld]
2 # explicit_defaults_for_timestamp
3 explicit_defaults_for_timestamp=true

Problem Description

MySQL5.6.6 ago:

If the timestamp column specifies the type of value is null, defaults to the current timestamp.

If the column type is not specified timestamp value is null, i.e. no transfer value, a default value is non-null.

The first timestamp column of the table, if no value is null, a default value is not set, will be set to the current time when the inserts and updates.

All columns after the timestamp table the first timestamp column, if not defined as null, defined in the default value, is set to '0000-00-00 00:00:00'.

MySQL5.6.6 later, you need to set in the configuration file  explicit_defaults_for_timestamp = to true  , its meaning is:

If the timestamp column specifies the type of value is null, defaults to the current timestamp.

If the column type is not specified timestamp value is null, i.e. no traditional values, default to null.

Statement timestamp type column is not able to null, but does not specify a default value. When inserted into the timestamp column does not specify the type of value, if it is strictly sql mode, it will throw an error if strict sql mode is not enabled, this column will be assigned to '0000-00-00 00:00:00', while there caveat.

Import and export permission settings

Related Blog

1 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled.
2 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
3 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server.

Solution

Join in the configuration file:

. 1  [ mysqld ] 
2  # Set Import and Export
 . 3 Secure-File-PRIV = D: \ All \ the MySQL \ File

Problem Description

Profiles in the  secure-file-priv  parameter is used to limit the import and export data to a specified directory:

When the value is null, is not allowed to import and export operations.

When the value of the specific folder, showing only import and export operations in the directory, the directory does not exist will be given.

When the value is not the specific value, not to limit the import and export operations folder.

Guess you like

Origin www.cnblogs.com/shamao/p/11112076.html