Copy data after mysql reinstallation

(Wow, programming Xiaobai's first blog, excited)

Q one: MySQL needs to be reinstalled, what should I do with the data.

    Method 1: It is better to export the data table as a .sql file, which is safer.

    Method 2: Copy the data file directly: it can be found in the programdata folder under the mysql installation disk. The specific path is: C:\ProgramData\MySQL\MySQL Server 5.7\Data. (If you can't find it, the folder is hidden, please refer to: MySQL5.7 finds the data folder https://blog.csdn.net/qq_26819733/article/details/52998297)

Q two: How to restore data after reinstallation

    After reinstalling Mysql, close the mysql service in the DOS command window: enter net stop mysql;

    Delete ib_logfile0 and ib_logfile1 in the data file in the current mysql installation directory. ibdata1

    Then copy the data table folder in the previously copied data file to the current data file, and copy the ibdata1 under the data folder and it is ok.

    

 

         

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325647168&siteId=291194637