In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to solve mysql errors. The problem of is marked as crashed and should be, the content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
The repair command I used was: myisamchk-r bbsthreads
Bbsthreads is the name of the table in which I have a problem. Of course, to use this command, you have to enter the storage path of the table in which you have the problem. For more detailed commands, please see help: myisamchk-- help
If you can't solve the problem with the above command, please see the back, which I reprinted.
There is something wrong with my website. When I visit it, it turns out to be a full-screen error report. Check the log. The error message is:
Table .dedecmsv4dede _ archives is marked as crashed and should be repaired
It is suggested that cms's article table dede_archives is marked with a problem and needs to be fixed. So quickly recover the historical data and find out the reason on the Internet. The problem will be solved eventually. The solution is as follows:
Locate the bin/myisamchk tool in the installation directory of mysql and enter:
Myisamchk-c-r. / data/dedecmsv4/dede_archives.MYI
Then the myisamchk tool will help you restore the index of the data table. Restart mysql and the problem is resolved.
Problem analysis:
1, the cause of the error, some netizens said that frequent queries and updates of the dede_archives table caused by index errors, because my page is not statically generated, but a dynamic page, so I agree with this view. It is also said that the MYSQL database has been damaged for some reason, such as the sudden power outage of the database server and some operation on the original file of the table when the database table provides services may cause the MYSQL database table to be damaged and unable to read the data. In short, it is because of some unpredictable problems that the table is damaged.
The question number is 145.
2. Solution to the problem.
When you try to fix a problem with a broken table, there are three types of repair. If you get an error message that a temporary file cannot be created, delete the file indicated by the message and try again-this is usually left over from the last repair operation.
The three repair methods are as follows:
% myisamchk-- recover-- quick / path/to/tblName
% myisamchk-- recover / path/to/tblName
% myisamchk-- safe-recover / path/to/tblName
The first is the fastest to fix the most common problems, while the last is the slowest to fix problems that cannot be fixed by other methods.
Check and repair MySQL data files
If the above method cannot repair a damaged table, you can also try the following two techniques before you give up:
If you suspect that there is an irreparable error in the table's index file (* .MYI), or even lose the file, you can use the data file (* .MYD) and the data format file (* .frm) to regenerate it. First make a copy of the data file (tblName.MYD). Restart your MySQL service and connect to it and delete the contents of the table using the following command:
Mysql > DELETE FROM tblName
When you delete the contents of the table, a new index file is created. Log out and shut down the service again, and then overwrite the new (empty) data file with the data file you just saved (tblName.MYD). Finally, use myisamchk to perform a standard fix (the second method above) to regenerate the index data based on the contents of the table's data and the table's format file.
If your table format file (tblName.frm) is missing or an irreparable error has occurred, but you know how to use the appropriate CREATE TABLE statement to regenerate the table, you can regenerate a new .frm file and use it with your data file and index file (if there is a problem with the index file, use the above method to rebuild a new one). First make a copy of the data and index file, and then delete the original file (delete all records about the table in the data directory).
Start the MySQL service and create a new table using the original CREATE TABLE file. The new .frm file should work, but you'd better perform a standard fix (the second method above).
3. Introduction to myisamchk tools (see mysql's official manual)
You can use the myisamchk utility to get information about database tables or to check, fix, or optimize them. Myisamchk applies to MyISAM tables (tables corresponding to .MYI and .MYD files).
Call the method of myisamchk:
Shell > myisamchk [options] tbl_name...
Options specifies what you want myisamchk to do. Describe them later. You can also get a list of options by calling myisamchk-- help.
Tbl_name is the database table you want to check or repair. If you do not run myisamchk somewhere in the database directory, you must specify the path to the database directory because myisamchk does not know where your database is located. In fact, myisamchk doesn't care whether the file you're working on is in a database directory; you can copy the file corresponding to the database table somewhere else and perform a restore operation there.
If you like, you can name several tables with the myisamchk command line. You can also specify a table by naming the index file (with the suffix ".MYI"). It allows you to specify all tables in a directory by using the pattern "* .MYI". For example, if you are in a database directory, you can check all the MyISAM tables in the directory like this:
Shell > myisamchk * .MYI
If you are not in the database directory, check all the tables there by specifying the path to the directory:
Shell > myisamchk / path/to/database_dir/*.MYI
You can even check all tables in all databases by specifying a wildcard for the path to the MySQL data directory:
Shell > myisamchk / path/to/datadir/*/*.MYI
The recommended way to quickly check all MyISAM tables is:
Shell > myisamchk-- silent-- fast / path/to/datadir/*/*.MYI
If you want to check all MyISAM tables and fix any broken tables, you can use the following command:
Shell > myisamchk-silent-force-fast-update-state
-O key_buffer=64M-O sort_buffer=64M
-O read_buffer=1M-O write_buffer=1M
/ path/to/datadir/*/*.MYI
This command assumes that you have more free memory than 64MB. For more information about allocating memory with myisamchk, see section 5.9.5.5, "myisamchk memory usage."
When you run myisamchk, you must make sure that other programs do not use tables. Otherwise, when you run myisamchk, the following error message is displayed:
Warning: clients are using or havent closed the table properly
This means that you are trying to check a table that is being updated by another program that has not closed the file or has terminated and has not closed the file correctly (such as a mysqld server).
If mysqld is running, you must force any table modifications that are still in memory to be emptied through FLUSH TABLES. When you run myisamchk, you must make sure that other programs do not use tables. The easiest way to avoid this problem is to use CHECK TABLE instead of myisamchk to check the table
About how to resolve mysql errors. This is the end of the question of is marked as crashed and should be. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.