init_file '/var/lib/mysql/.-.work.XNDQaWRXUvLyEEJx'로 인해 MySQL이 시작되지 않습니다.

init_file '/var/lib/mysql/.-.work.XNDQaWRXUvLyEEJx'로 인해 MySQL이 시작되지 않습니다.

MySQL이 매일 밤 계속 종료되는 이유를 알아내려고 노력 중입니다. 특히 MySQL은 매일 밤 자체적으로 다시 시작되지만(이유도 알 수 없음) 백업 시작에 실패하고 중단됩니다. 어떤 날은 성공적으로 다시 시작되고 모든 것이 작동하지만 대부분의 날은 그렇지 않기 때문에 매일 아침 다시 시작하는 스크립트를 만들어야 했습니다. 매일 아침 오전 8-9시(UTC)쯤에 mySQL이 두 번 다시 시작되지만 두 번째 다시 시작에서는 실패합니다. 일부 .-.work 초기화 파일을 찾을 수 없고 그 이유가 확실하지 않기 때문에 시작 시 실패합니다.

매일 밤 MySQL을 사용하면서 발견한 두 가지 사례가 있습니다.

  1. 성공적으로 다시 시작됩니다. 그러나 will은 init 파일을 실행하거나 전혀 실행하지 않는다고 말합니다.
  2. 다시 시작이 실패합니다. 이 경우 항상 초기화 파일을 찾을 수 없기 때문입니다.

요약 정보:

  • MySQL은 매일 아침 UTC 오전 8~9시에 다시 시작됩니다.
  • MySQL 다시 시작 성공: 중지 > 시작 > 중지 > 시작
  • MySQL 다시 시작 실패: 중지 > 시작(중단/실패) > 중지

추가 정보:

  • 센트OS 6.8
  • MySQL 5.7.17

초기화 파일로 인해 MySQL이 실패함:

2018-02-25T08:45:09.782610Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-25T08:45:09.784928Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-log) starting as process 11221 ...
2018-02-25T08:45:09.798909Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-25T08:45:09.798938Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-25T08:45:09.798960Z 0 [Note] InnoDB: Uses event mutexes
2018-02-25T08:45:09.798971Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2018-02-25T08:45:09.798992Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-25T08:45:09.799007Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-25T08:45:09.799444Z 0 [Note] InnoDB: Number of pools: 1
2018-02-25T08:45:09.799600Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-25T08:45:09.801717Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-25T08:45:09.816978Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-25T08:45:09.821022Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-25T08:45:09.846219Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-25T08:45:10.072617Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-25T08:45:10.072727Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-25T08:45:10.093784Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-25T08:45:10.094893Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-25T08:45:10.094908Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-25T08:45:10.095372Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-25T08:45:10.145560Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 28375479994
2018-02-25T08:45:10.145846Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-02-25T08:45:10.145941Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-25T08:45:10.162499Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180225  1:45:10
2018-02-25T08:45:10.181824Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-02-25T08:45:10.186627Z 0 [Warning] CA certificate ca.pem is self signed.
2018-02-25T08:45:10.188420Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-25T08:45:10.188488Z 0 [Note] IPv6 is`enter code here` not available.
2018-02-25T08:45:10.188521Z 0 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2018-02-25T08:45:10.188545Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2018-02-25T08:45:10.304549Z 0 [ERROR] Incorrect definition of table performance_schema.replication_connection_status: expected column 'RECEIVED_TRANSACTION_SET' at position 7 to have type longtext, found type text.
2018-02-25T08:45:10.305926Z 0 [ERROR] Incorrect definition of table performance_schema.replication_group_member_stats: expected column 'COUNT_TRANSACTIONS_ROWS_VALIDATING' at position 6, found 'COUNT_TRANSACTIONS_VALIDATING'.
2018-02-25T08:45:10.311827Z 0 [Note] Event Scheduler: Loaded 0 events
2018-02-25T08:45:10.311944Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2018-02-25T08:45:10.311957Z 0 [Note] Beginning of list of non-natively partitioned tables
2018-02-25T08:45:10.880682Z 0 [Note] End of list of non-natively partitioned tables
2018-02-25T08:45:10.880729Z 0 [Note] Execution of init_file '/var/lib/mysql/.-.work.gjy3b8Gov_chCz89' started.
2018-02-25T08:45:10.880806Z 0 [ERROR] /usr/sbin/mysqld: File '/var/lib/mysql/.-.work.gjy3b8Gov_chCz89' not found (Errcode: 2 - No such file or directory)
2018-02-25T08:45:10.880816Z 0 [ERROR] Aborting

매일 밤 DB를 다시 시작하는 것이 조사해야 할 또 다른 문제라는 것을 알고 있지만 이 전체 문제를 어디서부터 시작해야 할지 잘 모르겠습니다. 왜 해당 파일을 찾나요? 어떻게 생성되고 있나요? 어떻게 해결하나요? 모든 도움을 주시면 감사하겠습니다.

(편집) 주제 자격을 더 잘 충족하기 위해 여기에 다시 게시했습니다.

(편집 2) my.cnf 파일은 다음과 같습니다.

    [mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log_timestamps = UTC

general_log
general_log_file = /var/log/general_query.log
log_error_verbosity = 3
max_allowed_packet = 256M
slow_query_log_file = /var/log/slow-queries.log
slow-query-log

답변1

내부 테이블 중 하나가 올바르게 설정되지 않은 것 같습니다.

Incorrect definition of table performance_schema.replication_connection_status: expected column 'RECEIVED_TRANSACTION_SET' at position 7 to have type longtext, found type text.

나는 mysql이 가지고 있는 모든 데이터베이스를 덤프하고 다음을 사용하여 사용자/권한을 덤프할 것을 제안합니다.

mysql -u root -p password --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql ${MYSQL_CONN} --skip-column-names -A | sed 's/$/;/g' > MySQLUserGrants.sql

msyql 패키지를 제거하고 mysql을 다시 설치한 다음 데이터베이스/사용자/권한을 복원하십시오.

관련 정보