AnswerBun.com

ERROR 2002 (HY000) while trying to connect to MariaDB

Unix & Linux Asked by burslf on January 2, 2022

I’m on Linux Mint 19 and use MariaDB as database server for my wordpress site in localhost.

I try to run MariaDB and when I check the status running
systemctl status mysql.service

I get this message:


● 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.

And when I launch journalctl -xe I get :

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

One Answer

The main problem is that the InnoDB engine is not initialising properly. And is apparently, already running. This answer is taken from https://stackoverflow.com/a/35978229/1525392

First, list MySQL processes using the ps command:

ps aux | grep mysql

enter image description here

And then kill the process

sudo kill 56311

Answered by anandogc on January 2, 2022

Add your own answers!

Related Questions

KDE plasma update

1  Asked on February 17, 2021 by jazahalka

       

python3 binary in /usr/local/bin but also…not?

1  Asked on February 17, 2021 by sam-dillard

     

How can I migrate/backup/restore a virt-manager snapshot?

1  Asked on February 16, 2021 by user73383

 

awk match last record and print

3  Asked on February 16, 2021 by darioit

   

How to stop marking while in tmux copy-mode?

2  Asked on February 15, 2021 by shuzheng

       

Configuring Debian Buster (10) for IPv6 with DHCP

2  Asked on February 13, 2021 by chmike

   

tar / pack `a-r` “unreadable” files

0  Asked on February 13, 2021 by ald-in

       

How to change ssh agent unix socket location on server side

2  Asked on February 13, 2021 by aisbaa

 

When linux use https_proxy instead of http_proxy?

1  Asked on February 12, 2021 by user103567

   

curl REST calls with Pagination

0  Asked on February 11, 2021 by laktak

     

How to mount a cifs share from a SMB3 linux server?

1  Asked on February 11, 2021 by elbarna

 

How to make grep to blink the matched pattern?

1  Asked on February 11, 2021 by s

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir