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
WilliamNow · 09.04.2026 at 18:45
Casinacho Casino Review. Casinacho Casino Review Casinacho Casino is a popular online gambling platform that offers a wide range of games for players to enjoy. With a sleek and user-friendly interface, players can easily navigate through the site and find their favorite games with ease. In this review, we will take a closer look at what Casinacho Casino https://casi-casinacho.ca/ has to offer and why it is a top choice for many online gamblers. One of the standout features of Casinacho Casino is its impressive selection of games. From classic table games like blackjack and roulette to popular slots titles, players are sure to find something that suits their preferences. The casino also regularly updates its game library, so there is always something new and exciting to try. In addition to its wide range of games, Casinacho Casino also offers a number of bonuses and promotions to keep players coming back for more. From welcome bonuses for new players to loyalty rewards for existing ones, there are plenty of opportunities to boost your bankroll and increase your chances of winning big. Another key feature of Casinacho Casino is its commitment to customer satisfaction. The casino offers a dedicated customer support team that is available 24/7 to assist with any issues or queries that may arise. Whether you have a question about a game or need help with a withdrawal, the support team is always on hand to help. Casinacho Casino also takes player security seriously, with state-of-the-art encryption technology in place to protect personal and financial information. This means that players can enjoy their favorite games with peace of mind, knowing that their data is safe and secure. Overall, Casinacho Casino is a top choice for online gamblers looking for a reliable and enjoyable gaming experience. With its wide selection of games, generous bonuses, and excellent customer support, it is easy to see why so many players choose to play at Casinacho Casino. Whether you are a seasoned pro or just starting out, this casino has something for everyone. So why not give it a try and see for yourself what makes Casinacho Casino stand out from the crowd?