How to enable explicit_defaults_for_timestamp?

5

I installed MySQL Server 5.6. When I try to connect the MySQL server running mysqld.exe, I get the following message:

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

In fact, the solution is in the documentation, but I have not found a way to put it into practice. Some say to put explicit_defaults_for_timestamp = true in the file my.ini , others say to put in the my.cnf file, but there are none of those files here. They also told me that it is possible to resolve this by putting MySQL as a Windows service, but I do not see it in the list of services.

How can I fix this problem and start the server normally?

I created the file my.ini manually, the error disappeared, but another one appeared twice:

2014-08-28 19:27:45 1292 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\Patrick.lower-test
2014-08-28 19:27:45 1292 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\Patrick.lower-test

When I try to run mysqld.exe , when I try to run mysql.exe the following appears:

ERROR 2003 <HY000>: Can't connect to MySQL server on 'localhost' <10061>

Today I tried to start MySQL over NetBeans 8.0.1 and this appeared:

2014-09-22 23:32:55 2580 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\Patrick.lower-test
2014-09-22 23:32:58 2580 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\Patrick.lower-test
2014-09-22 23:32:58 2580 [Note] Plugin 'FEDERATED' is disabled.
2014-09-22 23:33:02 2580 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-09-22 23:33:02 2580 [Note] InnoDB: The InnoDB memory heap is disabled
2014-09-22 23:33:02 2580 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-09-22 23:33:02 2580 [Note] InnoDB: Memory barrier is not used
2014-09-22 23:33:02 2580 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-22 23:33:02 2580 [Note] InnoDB: Not using CPU crc32 instructions
2014-09-22 23:33:03 2580 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-09-22 23:33:04 2580 [Note] InnoDB: Completed initialization of buffer pool
2014-09-22 23:33:04 2580 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode
2014-09-22 23:33:04 2580 [ERROR] InnoDB: The system tablespace must be writable!
2014-09-22 23:33:04 2580 [ERROR] Plugin 'InnoDB' init function returned error.
2014-09-22 23:33:04 2580 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-09-22 23:33:04 2580 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-09-22 23:33:04 2580 [ERROR] Aborting

2014-09-22 23:33:05 2580 [Note] Binlog end
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'partition'
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-09-22 23:33:05 2580 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_METRICS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_CMP'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'INNODB_TRX'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'BLACKHOLE'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'ARCHIVE'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'MRG_MYISAM'
2014-09-22 23:33:06 2580 [Note] Shutting down plugin 'MyISAM'
2014-09-22 23:33:07 2580 [Note] Shutting down plugin 'MEMORY'
2014-09-22 23:33:07 2580 [Note] Shutting down plugin 'CSV'
2014-09-22 23:33:07 2580 [Note] Shutting down plugin 'sha256_password'
2014-09-22 23:33:31 2580 [Note] Shutting down plugin 'mysql_old_password'
2014-09-22 23:33:31 2580 [Note] Shutting down plugin 'mysql_native_password'
2014-09-22 23:33:31 2580 [Note] Shutting down plugin 'binlog'
2014-09-22 23:33:31 2580 [Note] C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe: Shutdown complete
    
asked by anonymous 24.08.2014 / 06:44

1 answer

2

I've gone through this problem and solved it as follows:

I edited the file my.cnf (which in my case because it is on a Debian linux server, is stored in /etc/mysql/my.cnf ) and in the [mysqld] tag I inserted the following definition:

explicit_defaults_for_timestamp = false

This way the [mysqld] tag in my my.cnf file looks like this:

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
explicit_defaults_for_timestamp = false

In your case, being Windows, I believe the difference would be only the location of the mysql configuration file, which is probably my.ini

    
27.11.2014 / 17:51