MYSQL does not start and shutdown

book

Article ID: 225384

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

MYSQL does not start and shutdown as soon as it is started. After adding in the my-spectrum.cnf file under

[mysqld]

log-error = /opt/CA/Spectrum/mysql/mysql.log

and restarting mysql, the mysql.log showed the following error:

...

2021-10-04T09:42:07.652673Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2021-10-04T09:42:07.652837Z 0 [Note] IPv6 is available.
2021-10-04T09:42:07.652862Z 0 [Note]   - '::' resolves to '::';
2021-10-04T09:42:07.652910Z 0 [Note] Server socket created on IP: '::'.
2021-10-04T09:42:07.653217Z 0 [ERROR] Another process with pid 1796 is using unix socket file.
2021-10-04T09:42:07.653230Z 0 [ERROR] Unable to setup unix socket lock file.
2021-10-04T09:42:07.653238Z 0 [ERROR] Aborting

2021-10-04T09:42:07.653259Z 0 [Note] Binlog end
2021-10-04T09:42:07.653349Z 0 [Note] Shutting down plugin 'ngram'
2021-10-04T09:42:07.653379Z 0 [Note] Shutting down plugin 'ARCHIVE'
2021-10-04T09:42:07.653392Z 0 [Note] Shutting down plugin 'partition'
2021-10-04T09:42:07.653405Z 0 [Note] Shutting down plugin 'BLACKHOLE'

...

2021-10-04T09:42:07.653691Z 0 [Note] Shutting down plugin 'InnoDB'
2021-10-04T09:42:07.653824Z 0 [Note] InnoDB: FTS optimize thread exiting.
2021-10-04T09:42:07.654342Z 0 [Note] InnoDB: Starting shutdown...
2021-10-04T09:42:07.754588Z 0 [Note] InnoDB: Dumping buffer pool(s) to /opt/CA/Spectrum/mysql/data/ib_buffer_pool
2021-10-04T09:42:07.757671Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 211004  5:42:07
2021-10-04T09:42:09.464429Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2886120276077
2021-10-04T09:42:09.466685Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-10-04T09:42:09.466707Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2021-10-04T09:42:09.466773Z 0 [Note] Shutting down plugin 'MEMORY'
2021-10-04T09:42:09.466778Z 0 [Note] Shutting down plugin 'CSV'
2021-10-04T09:42:09.466786Z 0 [Note] Shutting down plugin 'MyISAM'
2021-10-04T09:42:09.466801Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2021-10-04T09:42:09.466805Z 0 [Note] Shutting down plugin 'sha256_password'
2021-10-04T09:42:09.466809Z 0 [Note] Shutting down plugin 'mysql_native_password'
2021-10-04T09:42:09.466961Z 0 [Note] Shutting down plugin 'binlog'
2021-10-04T09:42:09.467350Z 0 [Note] /opt/CA/Spectrum/mysql/bin//mysqld: Shutdown complete

Environment

Release : 10.4.1

Component :

Resolution

It looks like that the process with pid 1796 is using the unix socket file.

Run:

lsof -U | grep -i mysql

to see which process (if any) owns the socket and take appropriate actions. 

If you're sure that there is no other MySQL process running, you can simply delete the mysql.sock file.
When MySQL starts, if the socket doesn't exist, it will recreate it.