so this is my first post in 2024, probably would write again regularly.
today i try to install mariadb 10.5 on rocky linux 8.9 and it is sucessfully installed but it failed to start.
this is the error message from systemctl status:
# systemctl status mysqld
? mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2024-01-03 17:10:09 WIB; 6min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 807 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)
Process: 1306 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE)
Process: 1282 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 807 (code=exited, status=1/FAILURE)
Jan 03 17:10:09 SERVER systemd[1]: Starting MariaDB 10.5 database server...
Jan 03 17:10:09 SERVER mysql-prepare-db-dir[1306]: Database MariaDB is not initialized, but the directory /var/lib/mysql is not empty, so initialization cannot be done.
Jan 03 17:10:09 SERVER mysql-prepare-db-dir[1306]: Make sure the /var/lib/mysql is empty before running mysql-prepare-db-dir.
Jan 03 17:10:09 SERVER systemd[1]: mariadb.service: Control process exited, code=exited status=1
Jan 03 17:10:09 SERVER systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 03 17:10:09 SERVER systemd[1]: Failed to start MariaDB 10.5 database server.
after searching google for possible solution, then i realize that mysql directory is already exist on /var/lib and it contains data in it.
Continue reading