I was advised, that I 'should' be able to take /var/lib/mysql and drop it into a clean os/system and it 'should' work.
But, it's not that simple it appears: So far:
I've confirmed that mysql is working/starting correctly. I then stopped server with 'systemctl stop mysql', confirmed it was stopped with 'systemctl status mysql'.
I then renamed /var/lib/mysql to /var/lib/mysqlOrig.
I then copied my sick HDD's /var/lib/mysql to the working system's /var/lib/mysql
Then issue:
- Code: Select all
systemctl start mysql
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
Then:
- Code: Select all
systemctl status mariadb.service
× 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 Sat 2022-04-30 23:19:17 ACST; 36s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 2831 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
Process: 2857 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 2892 ExecStart=/usr/libexec/mariadbd --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)
Main PID: 2892 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
CPU: 1.608s
Apr 30 23:19:15 fedora systemd[1]: Starting MariaDB 10.5 database server...
Apr 30 23:19:15 fedora mariadb-check-socket[2831]: Socket file /var/lib/mysql/mysql.sock exists.
Apr 30 23:19:15 fedora mariadb-check-socket[2831]: No process is using /var/lib/mysql/mysql.sock, which means it is a garbage, so it will be removed automatically.
Apr 30 23:19:16 fedora mariadb-prepare-db-dir[2857]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Apr 30 23:19:16 fedora mariadb-prepare-db-dir[2857]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Apr 30 23:19:16 fedora mariadbd[2892]: 2022-04-30 23:19:16 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.13-MariaDB) starting as process 2892 ...
Apr 30 23:19:17 fedora systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 30 23:19:17 fedora systemd[1]: mariadb.service: Failed with result 'exit-code'.
Apr 30 23:19:17 fedora systemd[1]: Failed to start MariaDB 10.5 database server.
Apr 30 23:19:17 fedora systemd[1]: mariadb.service: Consumed 1.608s CPU time.
I'm not actually sure where to go from here: I can't determine what the actual fault is, much less work out what to do about it.
Any help most appreciated.