i have this error when run repair?
myisamchk: error: 140 when opening MyISAM-table '/var/lib/mysql/zibarsho_karno/wp_yoast_seo_links.MYI'
how i can fix this ???
ls *.MYI | sed 's/\.[^.]*$//' | xargs myisamchk -F -U
Saved me here because of basename extra operand and other issue. Please note -F -U are for Fast and UPDATE STATUS flag. You can use without it.
This is a bug already reported since MySQL 5.6
Still happening in 8.0.11 so in the mean time you can use the walkarround solution.
Not using the MYI extension.
myisamchk --force --update-state var/lib/mysql/zibarsho_karno/wp_yoast_seo_links
As user Jesus Uzcanga already mentioned, it is an old bug which hasn't been fixed yet [current version is 8.0.15].
These commands are a workaround when you run it directly in the directory where the .MYI
files are located:
ls *.MYI | xargs basename -s .MYI | xargs myisamchk
It removes the extension and runs myisamchk
for each MyISAM data file.
xargs
. This seems to be a powerful command/program.
try use this :
find /var/lib/mysql/*/* -name '*.MYI' | sed -e 's/\.MYI$//' | xargs -I{} myisamchk -r -f -o {}
ls *.MYI | xargs basename -s .MYI | xargs -I{} myisamchk -r --force {}
myisamchk -a /var/lib/mysql/zibarsho_karno/wp_yoast_seo_links
Ref: bugs.mysql.com/bug.php?id=87729#c467037