Can you find this file? /root/ibdata1 I cant…
If not – you’re in serious trouble – there was an exceptionally heavy load on the co-located server computer you dragged to safety – and had caused all the database(s) to destroy themselves. Weather or not they – voted.
So, copy it from there:
cp /var/lib/mysql/ibdata1 /root/ibdata1
And while you sit confused about what had happened – it did. we’re leaving in a hurry. That is all.
True.
rm /var/lib/mysql/ibdata1
So stop all the instances – of mysql running on the computer. Several times – then edit my.cnf
find / -name my.cnf
vi /etc/mysql/my.cnf
[mysqld]
innodb_force_recovery=1
collation-server = utf8_unicode_ci
character-set-server = utf8
default_authentication_plugin = mysql_native_password
bind-address=0.0.0.0
log_error=/var/log/mysql/mysql_error.log
Copy the file then assign permissions to it:
cp /root/ibdata1 /var/lib/mysql/ibdata1
chown mysql:mysql /var/lib/mysql/ibdata1
chmod 777 /var/lib/mysql/ibdata1
Now start the server – it works! not so fast – it cant read anything.
2021-10-28T15:51:47.196646Z 8 [ERROR] [MY-012810] [InnoDB] innodb_force_recovery is on. We do not allow database modifications by the user. Shut down mysqld and edit my.cnf to set innodb_force_recovery=0
Do what it says. Remove innodb_force_recovery=1 from the [mysqld] section in my.cnf. so it now reads – innodb_force_recovery=0 through the slit. – I know that already.
2021-10-28T15:55:03.854705Z 21 [ERROR] [MY-011971] [InnoDB] Tablespace ‘stretch/wp_postmeta’ Page [page id: space=96, page number=21] log sequence number 12437592225 is in the future! Current system log sequence number 12331573084.
In the future? In the future – opening a window – to a place that does not exist by any other means – are your quarters. So, have some quarters to call home. In the future. lol sure. I get it. Thank you united states post office. Or an extremely – and I mean – extremely terrible pun – feed the meter.
If everything is unreadable – or un-intelligable you should know exactly what tables are contained within the database – or an old version of the database – however un-likely, you can recreate the tables manually – from “.ibd files”. Because while constructing a new index; a new /var/lib/mysql/ibdata1 file is then also created but you wouldn’t know it – a simple text file, “.sql” is a text file and “.ibd” is not.
.sql has the table structure – and “I have” the .ibd So, It actually knows what “tablespace” is before you had asked.
mysql> CREATE DATABASE test1; mysql> USE test1; mysql> CREATE TABLE `product` ( ... ) ENGINE=InnoDB; mysql> ALTER TABLE product DISCARD TABLESPACE; copy back the original ibd file to /$datadir/test1/ --> mysql> ALTER TABLE product IMPORT TABLESPACE