Problem
User tries to start the mysql 5.x/8x server using the following command
systemctl start mysql
but service is not running. examine the log /var/log/mysqld.log gives the following in loop
2022-08-22T12:48:03.709674Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 11902
2022-08-22T12:48:03.714871Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-22T12:48:04.580759Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-08-22T12:48:04.646774Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-08-22T12:48:04.738351Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-08-22T12:48:04.738501Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-08-22T12:48:04.766186Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/data/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2022-08-22T12:48:04.774171Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.23).
2022-08-22T12:48:06.313131Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
need to run debug mode to check which errors occurs
mysqld --user=mysql --basedir=/var/lib/mysql --verbose
Problem
User gets the following error
mysqld: Can't open shared library '/data/mysql/lib64/mysql/plugin/component_reference_cache.so' (errno: 0 /data/mysql/lib64/mysql/plugin/component_reference_cache.so: cannot open shared object file: No such file or directory)
mysqld: Cannot load component from specified URN: 'file://component_reference_cache'.
Solution
The problem occurs since you specified a wrong directory for basedir and the plugins components didn't load
specify the directory for plugins to load
mysqld --user=mysql --basedir=/data/mysql --plugin-dir=/usr/lib64/mysql/plugin/ --verbose
Problem
Server keeps restarting
2022-08-22T14:09:04.802588Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.23’ socket: ‘/data/mysql/mysql.sock’ port: 3306 MySQL Community Server – GPL.
2022-08-22T14:09:04.810740Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.23).
Solution
Check directory for additional settings.
/systemd/system/mysqld.service.d/
My issue was old system administrator added commands to execute on startup file /systemd/system/mysqld.service.d/override.conf
but the script couldn’t executed mysql didn’t return error just keeps restarted
Solution with password change
systemctl stop mysqld
mv /etc/systemd/system/mysqld.service.d/override.conf /tmp
#for complete database wipeout
#mysqld --initialize
systemctl start mysqld
grep password /var/log/mysqld.log
mysql -u root -p <PASSWORD FROM ABOVE >
#change password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPassword!!';
Problem with directory permissions
chown -R mysql:mysql /var/lib/mysql/
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →