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

DonaldChads · 30.03.2026 at 15:33

Lending crypto for passive income. Lending crypto for passive income has become a popular way for individuals to earn money in the digital asset space. This practice involves lending out your cryptocurrency to others in exchange for a return on your investment. It is a simple and straightforward way to generate passive income without having to actively trade or manage your assets on a daily basis. One of the main benefits of lending crypto https://kinetic-market.pro/ is the potential for high returns. The interest rates offered on crypto lending platforms can be much higher than traditional savings accounts or other investment options. This means that you can earn a significant amount of money just by holding onto your cryptocurrency and allowing others to borrow it. Another advantage of lending crypto is the flexibility it offers. You can choose how much of your cryptocurrency to lend out, for how long, and at what interest rate. This allows you to tailor your lending strategy to meet your individual financial goals and risk tolerance. You can also withdraw your funds at any time, giving you the freedom to access your money whenever you need it. Lending crypto is also a relatively low-risk way to earn passive income. Most lending platforms have built-in security measures to protect your funds, such as collateral requirements and insurance policies. Additionally, the crypto market has shown steady growth over the years, making it a potentially lucrative investment opportunity for those looking to earn passive income. There are several different ways to lend out your cryptocurrency. One option is to use a centralized lending platform, where you deposit your funds and the platform matches you with borrowers looking to borrow cryptocurrency. These platforms typically offer higher interest rates than traditional banks and are a convenient option for those looking to earn passive income without much effort. Another option is decentralized lending platforms, also known as decentralized finance (DeFi) protocols. These platforms operate on blockchain technology and allow users to lend and borrow cryptocurrency directly from each other, without the need for a middleman. DeFi lending platforms often offer even higher interest rates than centralized platforms, making them an attractive option for those looking to maximize their passive income potential. When lending out your cryptocurrency, it is important to do your due diligence and research the platform you are using. Make sure the platform has a good reputation, strong security measures, and a transparent fee structure. Additionally, consider diversifying your lending portfolio to reduce risk and maximize your potential returns. In conclusion, lending crypto for passive income is a viable option for those looking to earn money in the digital asset space. With high potential returns, flexibility, and relatively low risk, crypto lending offers a convenient way to generate passive income without the need for active trading or management. By utilizing the various lending platforms available, you can earn money while holding onto your cryptocurrency assets and potentially grow your wealth over time.

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

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