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

Gregorymob · 25.03.2026 at 17:19

Decentralized exchange smart routing. Decentralized exchange smart routing is a concept that has gained significant attention in the world of cryptocurrency trading. This innovative approach to trading allows users to execute trades across multiple decentralized exchanges in a seamless and efficient manner. Decentralized exchanges, or DEXs, have become increasingly popular in recent years due to their transparency, security, and ability to operate without the need for a central authority. However, one of the challenges of using DEXs https://sparkdex.financial/ is the fragmentation of liquidity across multiple platforms. This can make it difficult for traders to find the best prices and execute trades quickly. Decentralized exchange smart routing addresses this issue by automatically routing trades to the most optimal exchange based on factors such as price, liquidity, and speed. This technology leverages algorithms and data analysis to identify the best trading opportunities and execute trades across multiple platforms simultaneously. By utilizing decentralized exchange smart routing, traders can access a larger pool of liquidity, achieve better prices, and reduce the risk of slippage. This technology also helps to improve the overall trading experience by providing a seamless and efficient way to trade across multiple exchanges. One of the key benefits of decentralized exchange smart routing is its ability to improve price discovery. By aggregating liquidity from multiple exchanges, traders can access a more accurate and up-to-date view of market prices. This can help to reduce the impact of market manipulation and ensure that traders are getting the best possible prices for their trades. Decentralized exchange smart routing also helps to improve the overall efficiency of trading on DEXs. By automating the process of routing trades, this technology can help to reduce the time and effort required to execute trades. This can be especially beneficial for high-frequency traders who need to execute trades quickly and efficiently. Another key advantage of decentralized exchange smart routing is its ability to enhance the security of trading on DEXs. By spreading trades across multiple exchanges, this technology can help to reduce the risk of hacks and other security threats. This can provide traders with greater peace of mind knowing that their assets are protected. In addition to these benefits, decentralized exchange smart routing can also help to increase the overall liquidity of DEXs. By aggregating liquidity from multiple platforms, this technology can help to deepen the order books on DEXs and make it easier for traders to find counterparties for their trades. Overall, decentralized exchange smart routing is a powerful technology that has the potential to revolutionize the way that trading is conducted on decentralized exchanges. By leveraging algorithms and data analysis, this technology can help to improve price discovery, efficiency, security, and liquidity on DEXs. As the cryptocurrency market continues to evolve, decentralized exchange smart routing will likely play an increasingly important role in shaping the future of trading.

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

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