가끔 로컬에서 디비작업할 일이 있어서 로컬에 mysql을 깔아두고 필요할때만 쓰고있었다.
근데 최근에 다시 쓸일이 있어 mysql을 작동하려는데 아래와 같은 메시지가 뜨며 제대로 실행되지 않았다.
~ brew services start mysql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/erusya/Library/LaunchAgents/homebrew.mxcl.mysql.plist exited with 5.Copy뭔소린가 싶어서 지피티한테 물어봤더니 모종의 brew 작업중 plist가 깨지거나 mysql 자체의 오류가 있어서 발생하는 문제라고 한다.
뭐 여러가지 문제원인은 제시하는데 정확한 내용을 알아보고자 아래와 같은 명령어로 mysql를 다시 실행해보았다.
~ mysqld --user=$(whoami)
2025-04-30T07:39:36.633821Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2025-04-30T07:39:36.773921Z 0 [System] [MY-010116] [Server] /opt/homebrew/Cellar/mysql/9.2.0/bin/mysqld (mysqld 9.2.0) starting as process 3580
2025-04-30T07:39:36.775117Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
2025-04-30T07:39:36.779699Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-04-30T07:39:36.828622Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-04-30T07:39:36.830401Z 1 [ERROR] [MY-014060] [Server] Invalid MySQL server upgrade: Cannot upgrade from 80300 to 90200. Upgrade to next major version is only allowed from the last LTS release, which version 80300 is not.
2025-04-30T07:39:36.830465Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-04-30T07:39:36.830477Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-04-30T07:39:36.846078Z 0 [System] [MY-010910] [Server] /opt/homebrew/Cellar/mysql/9.2.0/bin/mysqld: Shutdown complete (mysqld 9.2.0) Homebrew.
2025-04-30T07:39:36.846086Z 0 [System] [MY-015016] [Server] MySQL Server - end.Copymysqld --user=$(whoami) 명령어로 실행했을때 뜨는 에러창이었는데, 문제는 즉슨 내가 구형버전(Mysql 8버전)에서 생성된 데이터 디렉토리를 가지고있는데 실행하는 프로그램이 9버전이라 자동업데이트과정에서 충돌이 난 상황이었다.
뭐 어쩌겠는가 들어있는 데이터가 구버전이니까 다시 버전을 낮출수밖에...
brew uninstall mysql
brew install mysql@8.0Copy위와같은 brew 명령어로 mysql을 삭제하고 버전을 8버전으로 지정해서 mysql을 다시 설치해준다.
이후 기존 mysql의 실행명령간 링크를 끊고 8.0버전의 새로운 이름으로 brew 서비스를 등록해준다.
brew unlink mysql
brew link --force mysql@8.0
brew services start mysql@8.0Copy그리고 향후 mysql@8.0 서비스로 mysql을 실행시키면 되는것이다.
는 개뿔 안된다.
다포기하고 기존꺼 다 삭제하고 9.3버전으로 다시깔았다.
8.3버전 미만이랑 이런 괴리가있을줄이야이게 8.0버전하고 8.3버전하고 최신 9버전대하고 데이터 리스트 구조가 아예달라서 생기는문제하고한다.
뭐 로컬 디비여서 그냥 싹다밀고 재설치한다쳐도 이게 라이브 서비스에서 일어날꺼 생각하니 몸서리가 쳐진다.
이래서 다들 운용중인 서버업글 안하는거구나...
써글...
DB서버의 정상화 그것은 싹다날리고 재설치로 이루어졌다