When receiving the error
"InnoDB: Error: Attempted to open a previously opened tablespace. Previous tablespace"
when running a systemctl status mariadb.service it can often indicate a failed tablespace file.
Performing the following may rectify the issue:
- Open my.cnf
- Look for [mysqld]
- Just below [mysqld] insert innodb_force_recovery = 1
- Start MySQL Service
- Stop MySQL Service
- Remove the line from my.cnf (or my.ini for Windows) (innodb_force_recovery = 1)
- Start MySQL Service
- Run a "tail -f /var/log/mysql/`servername`.log" and watch for further errors. If the tablespace issue reoccurs backup the database, remove the database, remove the files associated it @ /var/log/mysql/username_database* and reimporting it will often correct the .id file(s)