mysql-Redo System Recovery MySQL process

Source: Internet
Author: User

Taking notes is a good habit, taking notes is a good habit, taking notes is a good habit!

The important thing to say three times.

Say more is a tear. The first time I installed MySQL, I met a lot of problems when I forgot to record it. Home hard drive full, so bought a 4T hard disk reload system. The development environment was re-installed after the system was re-installed. Anaconda3,pycharm,mongodb,pycharm ... When you get to MySQL, you have a variety of problems.

1, first move the mysql-5.7.18-win32 from the H plate to D:\Program files\mysql-5.7.18-win32.

2, set up the configuration file D:\Program Files\mysql-5.7.18-win32\my.ini, the content is

[Mysqld]
Basedir=d:\program Files\mysql-5.7.18-win32
Datadir=d:\program Files\mysql-5.7.18-win32\data
Tmpdir=d:\program files\mysql-5.7.18-win32\mysqltemp
innodb_buffer_pool_size=64m
3, establish tmpdir. This temporary directory must be set up according to the temporary directory configuration in the configuration, or the subsequent boot will be error!!!

4. Add environment variable Path=d:\program files\mysql-5.7.18-win32\bin

5. Open cmd, enter D:\Program files\mysql-5.7.18-win32\bin, execute mysqld--initialize

6, the D:\Program Files\mysql-5.7.18-win32\data moved to D:\Program Files\mysql-5.7.18-win32\data1, the implementation of Mysqld--install. After the success, you can see the service of MySQL beginning in the service of the system.

7, the previous step successfully, the generated data folder moved to the Data2 folder, the data1 just moved to data. Restore the original data, if not backup boot will error, the Data folder is not empty.

8, the implementation of net start MySQL, error can not start, then try Mysqld--remove, repeatedly executed several times.

9, the back finally successfully started. However, after the connection succeeds, a select post-service stop is performed on the original data. View Log D:\Program Files\mysql-5.7.18-win32\data\zgc-20170506nqh.err last behavior:

2017-05-06t15:44:39.138589z 3 [ERROR] innodb:trying to access page number 1784129 in space, space name Samp_db/dd_chap Tername, which is outside the tablespace bounds. Byte offset 0, Len 16384, I/O type read. If you get this error on Mysqld startup, please check the your my.cnf matches the Ibdata files Server.

Checked more, found that the log and data do not match. See: https://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html

10, so in My.ini add innodb_force_recovery = 6 Restart service, and then even in the query, finally restored!!!

Deliberately wrote this log to record the resolution process.

mysql-Redo System Recovery MySQL process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.