티스토리 뷰

기록남기기

mysql 컬럼 변경

양들의침묵1 2019. 5. 21. 10:39

- mysql 5.0.x ---> mysql 5.1.73 로 버전변경

mysql 테이블의 user 정보들에 대한 계정정보를 일부 알수 없어서
기존 mysql 5.0.x 에서 mysql dump를 통하여 백업을 하였고, mysql 5.1.7 에 그대로 복원하였다.

mysql 을 시작하고 mysql.log 를 확인해본 결과 아래와 같이 에러가 보였다.

[ERROR] mysql.user has no `Event_priv` column at position 29
[ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
[Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73-log'  socket: '/var/lib/mysql.sock'  port: 3306  Source distribution

이 내용을 보고 확인해본 결과 mysql  5.0.x 와 5.1.73 의 테이블에 컬럼이 다른 것을 확인하였고,
해당 내용은 아래와 같았다.

Event_privenum('N','Y') NOT NULL
Trigger_privenum('N','Y') NOT NULLevent_priv 

그래서 mysql 5.1.73 이 설치된 서버에 커럼을 추가 하였다.

mysql> ALTER TABLE `user` ADD `Event_priv` ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER `Create_user_priv`; 
mysql> ALTER TABLE `user` ADD `Trigger_priv` ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER `Event_priv`; 
mysql> flush privileges;
mysql 재시작 후 로그를 확인해본 결과 위와 같은 에러는 더이상 발생하지 않았다.


참고)  https://dba.stackexchange.com/questions/103723/error-1054-42s22-unknown-column-plugin-in-mysql-user


'기록남기기' 카테고리의 다른 글

jetty 설치  (0) 2020.11.26
k8s  (0) 2020.02.18
tomcat session cluster with redis  (2) 2019.09.19
mysql error : 1153 , 2020  (0) 2019.06.03
docker root 경로 변경  (0) 2019.05.21