1. 발생
docker에서 ubuntu 컨테이너를 생성한 후 Mysql-server 를 설치하는 과정에서 다음과 같은 불안한 permission denied가 발생한 것을 보았다.
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up libhtml-parser-perl:amd64 (3.76-1build2) ...
Setting up libhttp-message-perl (6.36-1) ...
Setting up mysql-server-8.0 (8.0.36-0ubuntu0.22.04.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot stat file /proc/528/fd/0: Permission denied
Cannot stat file /proc/528/fd/1: Permission denied
Cannot stat file /proc/528/fd/2: Permission denied
Cannot stat file /proc/528/fd/255: Permission denied
Cannot stat file /proc/20526/fd/0: Permission denied
Cannot stat file /proc/20526/fd/1: Permission denied
Cannot stat file /proc/20526/fd/2: Permission denied
Cannot stat file /proc/20526/fd/255: Permission denied
Cannot stat file /proc/21232/fd/0: Permission denied
Cannot stat file /proc/21232/fd/1: Permission denied
Cannot stat file /proc/21232/fd/2: Permission denied
Cannot stat file /proc/21232/fd/3: Permission denied
Cannot stat file /proc/21232/fd/4: Permission denied
Cannot stat file /proc/21232/fd/5: Permission denied
Cannot stat file /proc/21232/fd/6: Permission denied
Cannot stat file /proc/21232/fd/7: Permission denied
Cannot stat file /proc/21232/fd/8: Permission denied
Cannot stat file /proc/21232/fd/10: Permission denied
Cannot stat file /proc/21233/fd/0: Permission denied
Cannot stat file /proc/21233/fd/1: Permission denied
Cannot stat file /proc/21233/fd/2: Permission denied
Cannot stat file /proc/21233/fd/3: Permission denied
Cannot stat file /proc/21233/fd/4: Permission denied
Cannot stat file /proc/21233/fd/5: Permission denied
Cannot stat file /proc/21233/fd/6: Permission denied
Cannot stat file /proc/21233/fd/7: Permission denied
Cannot stat file /proc/21233/fd/9: Permission denied
Cannot stat file /proc/21233/fd/10: Permission denied
Cannot stat file /proc/21233/fd/11: Permission denied
Cannot stat file /proc/21233/fd/12: Permission denied
Cannot stat file /proc/21234/fd/0: Permission denied
Cannot stat file /proc/21234/fd/1: Permission denied
Cannot stat file /proc/21234/fd/2: Permission denied
Cannot stat file /proc/21234/fd/3: Permission denied
Cannot stat file /proc/21234/fd/4: Permission denied
Cannot stat file /proc/21234/fd/5: Permission denied
Cannot stat file /proc/21234/fd/6: Permission denied
Cannot stat file /proc/21234/fd/7: Permission denied
Cannot stat file /proc/21234/fd/8: Permission denied
Cannot stat file /proc/21234/fd/9: Permission denied
Cannot stat file /proc/21234/fd/10: Permission denied
Cannot stat file /proc/21234/fd/11: Permission denied
Cannot stat file /proc/21234/fd/12: Permission denied
Cannot stat file /proc/21234/fd/13: Permission denied
Cannot stat file /proc/21234/fd/14: Permission denied
Cannot stat file /proc/21234/fd/15: Permission denied
Cannot stat file /proc/21234/fd/16: Permission denied
Cannot stat file /proc/21234/fd/17: Permission denied
Cannot stat file /proc/21234/fd/18: Permission denied
Cannot stat file /proc/21234/fd/19: Permission denied
Cannot stat file /proc/21234/fd/20: Permission denied
Cannot stat file /proc/21234/fd/21: Permission denied
Cannot stat file /proc/21234/fd/22: Permission denied
Cannot stat file /proc/21234/fd/23: Permission denied
Cannot stat file /proc/21234/fd/24: Permission denied
Cannot stat file /proc/21234/fd/25: Permission denied
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 21763
그래서 /var/log/mysql 경로에 있는 error.log를 살펴 보면 다음과 같았다...
2024-03-29T09:11:47.791514Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.36-0ubuntu0.22.04.1) initializing of server in progress as process 21714
2024-03-29T09:11:47.801009Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-29T09:11:48.610977Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-29T09:11:51.996262Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2024-03-29T09:11:54.523547Z 6 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.36-0ubuntu0.22.04.1).
2024-03-29T09:11:59.788048Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.36-0ubuntu0.22.04.1) starting as process 21761
2024-03-29T09:11:59.799174Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-29T09:11:59.908373Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-29T09:12:00.169069Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-03-29T09:12:00.169124Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-03-29T09:12:00.179121Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2024-03-29T09:12:00.194932Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2024-03-29T09:12:00.194994Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.36-0ubuntu0.22.04.1' socket: '/tmp/tmp.BZzYMLXgRv/mysqld.sock' port: 0 (Ubuntu).
2024-03-29T09:12:00.214386Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.36-0ubuntu0.22.04.1).
2024-03-29T09:12:01.733331Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.36-0ubuntu0.22.04.1) (Ubuntu).
2024-03-29T09:12:02.498245Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.36-0ubuntu0.22.04.1) starting as process 21833
2024-03-29T09:12:02.504079Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-29T09:12:02.616685Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-29T09:12:02.845675Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-03-29T09:12:02.845707Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-03-29T09:12:02.854028Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2024-03-29T09:12:02.885383Z 7 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.36-0ubuntu0.22.04.1).
2024-03-29T09:12:02.888748Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-03-29T09:12:04.463645Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.36-0ubuntu0.22.04.1) (Ubuntu).
일단 거의 마지막줄에 Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock 보면 33060포트에 연결이 되었다가 종료 되었다.
2.해결
https://askubuntu.com/questions/1129029/getting-strange-errors-while-downloading-mysql
다음에서 원인과 해결법을 찾았다.
일단
1. libaio가 설치되어 있는지 다음 명령어를 통해 확인한다.
apt-cache policy libaio1
1-1. 다음 명령어를 통해 버전이 나오지 않는 다면 다음 명령어를 통해 설치 있다면 스킵
sudo apt-get install libaio1 libaio-dev
2. aptitude 설치 후 aptitude 통해서 update (설치 되어 있으면 update만)
sudo apt-get install aptitude
sudo aptitude update
sudo aptitude upgrade
여기까지 하고 다시 mysql설치 하니 위의 오류가 발생하지 않았다. 위의 링크에 다른 방법도 있으니 이 방법이 안되면 시도해 보자!!
3. 번외
libaio란?(페도라에서의 libaio의 기능을 설명하는 글이다.)
aptitude란?
요약: apt-get보다 강력한 패키지 매니저이다.
https://www.debian.org/doc/manuals/aptitude/rn01re01.en.html
'Ubuntu' 카테고리의 다른 글
[Ubuntu]계정 생성 및 권한 부여 (0) | 2023.11.21 |
---|---|
[Ubunut] 가끔 사용하는 것 모음집 (0) | 2023.11.21 |