1) Устанавливаем необходимый софт

cd /root/
wget https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.6.5-1.el7.noarch.rpm
wget https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.7-1.el7.x86_64.rpm
yum install mysql-utilities-1.6.5-1.el7.noarch.rpm mysql-connector-python-2.1.7-1.el7.x86_64.rpm

2) Копируем всю директорию mysql, убедитесь что Вы имеете достаточное количество свободного дискового пространства

mkdir /root/corrupt_mysql
cp -r /var/lib/mysql /root/corrupt_mysql/

3) Запускаем mysql

systemctl start mysql

Если БД не запускается то постепенно повышаем параметр innodb_force_recovery от 2 и выше в /etc/my.cnf

Проставляем грант

mysql -e'grant all on . to frm@localhost identified by "MysqlFRMSecret678";'

4) Указываем имя поврежденной БД и восстанавливаем схему

DATABASE=brokendbname
for file in $(ls /root/corrupt_mysql/mysql/${DATABASE}/*.frm); do mysqlfrm --server=frm:MysqlFRMSecret678@localhost:/var/lib/mysql/mysql.sock --diagnostic $file | grep -v "WARNING" >> /root/corrupt_mysql/${DATABASE}_create.sql ; done
sed -i 's##utf8#g' /root/corrupt_mysql/${DATABASE}_create.sql

5) Удаляем поврежденную базу данных

mysql -e'drop database ${DATABASE};'
rm -rf /var/lib/mysql/${DATABASE}/

6) Комментируем в конфиге innodb_force_recovery и перезапускаем mysql

systemctl restart mysql

7) Создаем бд и загружаем схему

mysql -e'create database ${DATABASE};'
mysql --force ${DATABASE} < /root/corrupt_mysql/${DATABASE}_create.sql

8) Копируем файлы таблиц из ранее скопированной директории с поврежденной БД и восстанавливаем данные каждой таблицы, проставляем права

for table in $(mysql -e 'show tables from ${DATABASE};' | grep -v "Tables_in"); do mysql ${DATABASE} -e"ALTER TABLE $table DISCARD TABLESPACE;"; done
for table in $(mysql -e 'show tables from ${DATABASE};' | grep -v "Tables_in"); do rsync -avzP /root/corrupt_mysql/mysql/${DATABASE}/$table.ibd /var/lib/mysql/${DATABASE}/ ; done
chown -R mysql:mysql /var/lib/mysql/
for table in $(mysql -e 'show tables from ${DATABASE};' | grep -v "Tables_in"); do mysql ${DATABASE} -e"ALTER TABLE $table IMPORT TABLESPACE;"; done

Перезапускаем mysql

systemctl restart mysql

Проверяем данные в таблице


0 Comments

Charlestuh · 06.04.2026 at 15:38

Casinacho Casino Review: Bonuses, Games and Banking for Canadian Players. Casinacho Casino is a popular online gambling platform that offers a wide range of games and bonuses for Canadian players. In this review, we will take a closer look at the various features that make Casinacho Casino Nacho casino a top choice for Canadian players. One of the key attractions of Casinacho Casino is its generous bonuses and promotions. New players are greeted with a welcome bonus that can include free spins, bonus cash, or a combination of both. Additionally, the casino regularly offers promotions and special offers to existing players, including reload bonuses, cashback offers, and loyalty rewards. In terms of games, Casinacho Casino boasts an impressive selection of slots, table games, and live dealer games. The casino works with some of the leading software providers in the industry, including Microgaming, NetEnt, and Evolution Gaming, to offer players a diverse and high-quality gaming experience. Whether you enjoy classic slots, modern video slots, or live dealer games like blackjack and roulette, Casinacho Casino has something for everyone. Canadian players will also appreciate the banking options available at Casinacho Casino. The casino accepts a variety of payment methods, including credit and debit cards, e-wallets, and bank transfers. Withdrawals are processed quickly, and players can expect to receive their winnings in a timely manner. Casinacho Casino is also committed to providing a safe and secure gaming environment for its players. The casino uses state-of-the-art encryption technology to protect players’ personal and financial information, and all games are tested for fairness and randomness by independent auditors. In conclusion, Casinacho Casino is a top choice for Canadian players looking for a reliable and entertaining online gambling experience. With its generous bonuses, diverse game selection, and secure banking options, Casinacho Casino has everything a player could want in an online casino. Whether you’re a seasoned player or new to online gambling, Casinacho Casino has something to offer you. So why not give it a try and see for yourself what makes Casinacho Casino one of the best online casinos for Canadian players.

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *