저는 Linux Mint 19를 사용하고 있으며 MariaDB를 localhost의 WordPress 사이트용 데이터베이스 서버로 사용하고 있습니다.
MariaDB를 실행해보고 실행상태를 확인해보면
systemctl status mysql.service
다음 메시지가 나타납니다.
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql; generated)
Active: failed (Result: exit-code) since Fri 2020-07-24 21:00:26 IDT; 44s ago
Docs: man:systemd-sysv-generator(8)
Process: 2566 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
juil. 24 20:59:56 burslf mysqld[2810]: 2020-07-24 20:59:56 0 [Note] InnoDB: Transaction contains changes to 1 rows
juil. 24 20:59:56 burslf mysqld[2810]: 2020-07-24 20:59:56 0 [Note] InnoDB: 1 transactions in prepared state after recovery
juil. 24 20:59:56 burslf mysqld[2810]: 2020-07-24 20:59:56 0 [Note] Found 1 prepared transaction(s) in InnoDB
juil. 24 20:59:56 burslf mysqld[2810]: 2020-07-24 20:59:56 0 [ERROR] Found 1 prepared transactions! It means that mysqld was not shut down properly last time and critical recovery informati
juil. 24 20:59:56 burslf mysqld[2810]: 2020-07-24 20:59:56 0 [ERROR] Aborting
juil. 24 20:59:56 burslf mysqld[2810]:
juil. 24 21:00:26 burslf mysql[2566]: ...fail!
juil. 24 21:00:26 burslf systemd[1]: mysql.service: Control process exited, code=exited status=1
juil. 24 21:00:26 burslf systemd[1]: mysql.service: Failed with result 'exit-code'.
juil. 24 21:00:26 burslf systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
시작하면 journalctl -xe
다음을 얻습니다.
juil. 24 20:55:31 burslf mysqld[9689]: 2020-07-24 20:55:31 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:32 burslf audit[1482]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify"
juil. 24 20:55:32 burslf mysqld[1482]: 2020-07-24 20:55:32 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
juil. 24 20:55:32 burslf kernel: audit: type=1400 audit(1595613332.089:156): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
juil. 24 20:55:32 burslf mysqld[9689]: 2020-07-24 20:55:32 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:32 burslf mysqld[9689]: 2020-07-24 20:55:32 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:33 burslf mysqld[9689]: 2020-07-24 20:55:33 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:33 burslf mysqld[9689]: 2020-07-24 20:55:33 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:34 burslf mysqld[9689]: 2020-07-24 20:55:34 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:34 burslf mysqld[9689]: 2020-07-24 20:55:34 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:35 burslf mysqld[9689]: 2020-07-24 20:55:35 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:35 burslf mysqld[9689]: 2020-07-24 20:55:35 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:36 burslf mysqld[9689]: 2020-07-24 20:55:36 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:36 burslf mysqld[9689]: 2020-07-24 20:55:36 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:37 burslf mysqld[9689]: 2020-07-24 20:55:37 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:37 burslf mysqld[9689]: 2020-07-24 20:55:37 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:38 burslf mysqld[9689]: 2020-07-24 20:55:38 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:38 burslf mysqld[9689]: 2020-07-24 20:55:38 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:39 burslf mysqld[9689]: 2020-07-24 20:55:39 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:39 burslf mysqld[9689]: 2020-07-24 20:55:39 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:40 burslf mysqld[9689]: 2020-07-24 20:55:40 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:40 burslf mysqld[9689]: 2020-07-24 20:55:40 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:41 burslf mysqld[9689]: 2020-07-24 20:55:41 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:41 burslf mysqld[9689]: 2020-07-24 20:55:41 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [Note] InnoDB: Unable to open the first data file
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-cod
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
juil. 24 20:55:42 burslf mysqld[9689]: 2020-07-24 20:55:42 0 [Note] InnoDB: Starting shutdown...
juil. 24 20:55:43 burslf audit[9689]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify"
juil. 24 20:55:43 burslf kernel: audit: type=1400 audit(1595613343.029:157): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
juil. 24 20:55:43 burslf mysqld[9689]: 2020-07-24 20:55:43 0 [ERROR] Plugin 'InnoDB' init function returned error.
juil. 24 20:55:43 burslf mysqld[9689]: 2020-07-24 20:55:43 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
juil. 24 20:55:43 burslf mysqld[9689]: 2020-07-24 20:55:43 0 [Note] Plugin 'FEEDBACK' is disabled.
juil. 24 20:55:43 burslf mysqld[9689]: 2020-07-24 20:55:43 0 [ERROR] Unknown/unsupported storage engine: InnoDB
juil. 24 20:55:43 burslf mysqld[9689]: 2020-07-24 20:55:43 0 [ERROR] Aborting
juil. 24 20:55:43 burslf mysqld[9689]: Warning: Memory not freed: 520
juil. 24 20:55:43 burslf audit[9689]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify"
juil. 24 20:55:43 burslf audit[9689]: AVC apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="dev/null" pid=9689 c
juil. 24 20:55:43 burslf audit[9689]: AVC apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="dev/null" pid=9689 c
juil. 24 20:55:43 burslf audit[9689]: AVC apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="dev/null" pid=9689 c
juil. 24 20:55:43 burslf systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
juil. 24 20:55:43 burslf kernel: audit: type=1400 audit(1595613343.409:158): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
juil. 24 20:55:43 burslf kernel: audit: type=1400 audit(1595613343.409:159): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
juil. 24 20:55:43 burslf kernel: audit: type=1400 audit(1595613343.409:160): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
juil. 24 20:55:43 burslf kernel: audit: type=1400 audit(1595613343.409:161): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin
답변1
가장 큰 문제는 InnoDB 엔진이 올바르게 초기화되지 않았다는 것입니다. 분명히 이미 실행 중입니다. 이 답변은 다음에서 가져온 것입니다.https://stackoverflow.com/a/35978229/1525392
먼저 ps 명령을 사용하여 MySQL 프로세스를 나열합니다.
ps aux | grep mysql
그런 다음 프로세스를 종료하십시오.
sudo kill 56311