problem with the MYSQL database

edwardcarr

Beta member
Messages
1
Location
USA
Hello,
I work with the mysql database for a couple of months now could not open it, because there was an error: “Incorrect key file for table: '...'. Try to repair it”
Who can tell how open the database?
Thanks to all.
 
To fix this do the following please or in case it isn't enough for your mysql database restoration, then I would advise you to learn helpful threads dedicated to solving MySQL issues

http://community.office365.com/en-us/f/172/p/266451/815406.aspx
https://social.msdn.microsoft.com/F...ow-to-fix-my-sql-database?forum=sqldataaccess
https://www.repairtoolbox.com/mysqlrepair.html Repair Toolbox for MySQL – in case you can't get back mysql database, you may apply this one solution

Force InnoDB Recovery
1. Stop mysqld and back up all files located in the /var/lib/mysql/ directory:
2. # /etc/init.d/mysqld stop
3. # mkdir /root/mysql_backup
4. # cp -r /var/lib/mysql/* /root/mysql_backup/
5. Add the option innodb_force_recovery to the [mysqld] section in /etc/my.cnf. This option will allow you to start mysqld and create a database dump.
6. #/etc/my.cnf
7. [mysqld]
8. innodb_force_recovery = 4
NOTE: You can increase the option to five or six until you receive a proper dump.
9. Start the mysqld service:
10. # /etc/init.d/mysqld start
11. Dump all databases:
12. # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` -A | sed '1i\SET FOREIGN_KEY_CHECKS = 0;' > /root/dumpall.sql
If the dump fails with an error that reads:
Incorrect information in file: './psa/APSApplicationItems.frm' when using LOCK TABLES"`
... then you need to increase innodb_force_recovery and try to dump the databases again. If you are not able to dump the databases, try using method II ("Copy table content") or III ("Restore from the backup") below.
13. Remove all files from /var/lib/mysql/ except the mysql folder:
14. # rm -rf `ls -d /var/lib/mysql/* | grep -v "/var/lib/mysql/mysql"`
15. Remove the innodb_force_recovery option from the /etc/my.cnf file and restart mysqld:
16. # /etc/init.d/mysqld restart
17. Check the /var/log/mysqld.log for any errors.
18. Restore the databases from the dump:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` < /root/dumpall.sql
 
i suggest read your lines may be you have given wrong command to link the right table with the right field, or most probably the syntax error.
If all is great, you can go with the above mentioned solution.
 
Back
Top Bottom