Background my website was running all the time. suddenly, one day I found that my website was suspended. After troubleshooting, my database crashed. Login to Mysql: {code ...} to restart Mysql, the following error occurs: {code ...} because I found that Mysql has crashed, so I cannot back up data normally, so I thought of directly copying var... background
My website was running all the time. suddenly one day I found that my website had crashed. After troubleshooting, my database had crashed.
Login to Mysql:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
To restart Mysql, the following error occurs:
stop:unknown instancestart:job failed to start
I found that Mysql has crashed, so I cannot back up data normally. I thought of directly copying files under/var/lib/mysql for data backup.
Question
After I reinstall Mysql, I replaced the previous backups under/var/lib/mysql/dbname. after frm, start Mysql and find that the backup data is not in use, or the data in the newly created database.
After searching, I learned that innodb has to replace ibdata1, so after I replace it, I cannot start my Mysql. the prompt is:
start:failed to start
How can I restore my previous data?
Reply content: Background
My website was running all the time. suddenly one day I found that my website had crashed. After troubleshooting, my database had crashed.
Login to Mysql:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
To restart Mysql, the following error occurs:
stop:unknown instancestart:job failed to start
I found that Mysql has crashed, so I cannot back up data normally. I thought of directly copying files under/var/lib/mysql for data backup.
Question
After I reinstall Mysql, I replaced the previous backups under/var/lib/mysql/dbname. after frm, start Mysql and find that the backup data is not in use, or the data in the newly created database.
After searching, I learned that innodb has to replace ibdata1, so after I replace it, I cannot start my Mysql. the prompt is:
start:failed to start
How can I restore my previous data?
View the specific mysq error log file and solve the problem based on the error information.