CentOS 7에 MariaDB 10.4.32를 사용중임. (studydev home & Jira)
로그 파일에 비정상적으로 큰 파일이 생기고 있으며, 전반적 성능 저하가 발생하는 것을 수정 조치함.
MariaDB 또는 MySQL에서 사용중에 다음과 같은 문제가 발생할 수 있습니다.
문제
1. /var/log/message 에 MySQL 관련 비정상적인 로그가 쌓이면서 로그 파일 사이즈 증가 문제 발생
해당 문제는 아래와 같은 유형으로 나타납니다.
/var/log/messages 로그 중 일부
[ERROR] Incorrect definition of table mysql.table_stats: expected the type of column 'table_name' at position 1 to have character set 'utf8' but found character set 'utf8mb4' [ERROR] Incorrect definition of table mysql.table_stats: expected the type of column 'db_name' at position 0 to have character set 'utf8' but found character set 'utf8mb4'.
2. mysql_update 시도할 경우, 아래와 같이 문제가 발생
Phase 4/7: Running 'mysql_fix_privilege_tables' ERROR 1408 (HY000) at line 545: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
조치 방법
이런 증상이 있을 때, 가장 쉽게 해결하는 방법은, 관련 Table과 컬럼의 collation을 위 에러에 맞추어 변경하는 것입니다.
CLI나 MySQL 쿼리에 익숙하다면 아래와 같은 방법으로 시도.
잘 모르겠다. 자신이 없다. 아래와 같은 툴을 설치해서 접근하여 mysql 테이블에서 캐릭터셋 이상하게 에러 나는 테이블이나 컬럼의 collation을 변경 조치해줌.
사용하고 나면 지울 것을 권장함.
조치 후 변화
mysql_update가 정상 진행 완료.
/var/log/messages 에 mysql 관련 비정상 로그 안 쌓임.
PS, IO, MEM 상태 여유 생김.