시작하려고 해요mysql섬기는 사람AlmaLinux에서:
[asigor@89 etc]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
시작하지 못하는 것 같아요mysqld아니면 이렇게 할 때:
[asigor@89 etc]$ mysqld
2023-05-10T14:47:28.044565Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2023-05-10T14:47:28.044617Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-05-10T14:47:28.044643Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.30) starting as process 279360
2023-05-10T14:47:28.046672Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2023-05-10T14:47:28.046683Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2023-05-10T14:47:28.049143Z 0 [ERROR] [MY-010187] [Server] Could not open file '/var/log/mysql/mysqld.log' for error logging: Permission denied
2023-05-10T14:47:28.049221Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-05-10T14:47:28.049356Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.30) Source distribution.
그리고스도:
[asigor@89 etc]$ sudo mysqld start
2023-05-10T15:07:35.437541Z 0 [Warning] [MY-010918] [Server] 'default_authentica tion_plugin' is deprecated and will be removed in a future release. Please use a uthentication_policy instead.
2023-05-10T15:07:35.437570Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.30) starting as process 279878
2023-05-10T15:07:35.439010Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please r ead "Security" section of the manual to find out how to run mysqld as root!
2023-05-10T15:07:35.439051Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-05-10T15:07:35.439143Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.30) Source distribution.
어떤 팁/요령이 있나요?
고쳐 쓰다
[asigor@89 ~]$ sudo systemctl start mysql
[asigor@89 ~]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib
[asigor@89 ~]$ journalctl -u mysql.service
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
업데이트 2
@"Marcus Mueller"는 아래에 댓글을 달았습니다.
$ sudo systemctl start mysql
$ sudo journalctl -u mysql.service
-- Logs begin at Thu 2023-05-11 01:00:01 UTC, end at Fri 2023-05-12 07:43:08 UT>
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: Started MySQL S>
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: >
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: >
lines 1-4/4 (END)
-- Logs begin at Thu 2023-05-11 01:00:01 UTC, end at Fri 2023-05-12 07:43:08 UTC. --
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: Started MySQL Server.
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: Main process exited, code=exited,>
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: Failed with result 'exit-code'.
실수:"종료 코드"로 인해 실패했습니다..
업데이트 3
$ sudo journalctl -u mysql.service > journal.txt
파일에서 복사된 로그 콘텐츠:
-- Logs begin at Thu 2023-05-11 01:00:01 UTC, end at Fri 2023-05-12 10:13:00 UTC. --
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: Started MySQL Server.
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: Main process exited, code=exited, status=203/EXEC
May 12 07:42:58 89.162.205.92.host.secureserver.net systemd[1]: mysql.service: Failed with result 'exit-code'.
업데이트 4
$ sudo pgrep mysqld
$ sudo journalctl -u pgrep.service
-- Logs begin at Thu 2023-05-11 01:00:01 UTC, end at Fri 2023-05-12 11:22:12 UT>
-- No entries --
업데이트 5
어떻게든 mysql을 시작하려고 하는데 실패하는 것 같습니다.
systemctl mysqld.service start
상태 보기:
systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/etc/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2023-05-16 10:49:21 UTC; 37s ago
Process: 567142 ExecStart=/usr/bin/mysqld --defaults-file=/etc/mysql/my.cnf --datadir=/var/lib/mysql --socket=/var/run/mysqld/mysqld.>
Main PID: 567142 (code=exited, status=203/EXEC)
답변1
mysqld
루트로 실행 하지 마십시오 . 오류 메시지에서 실제로 알 수 있듯이sudo
.mysqld
사용자로 수동으로 실행하면asigor
/var/lib/mysql/에 콘텐츠가 생성되지 않습니다. 메시지에는 다음 내용도 포함되어 있습니다.
테스트 파일 /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test를 생성할 수 없습니다.
해결책은 간단 합니다 . mysqld를 수동으로 시작하지 말고 sudo systemctl start mysql
.journalctl -u mysql.service