How to recover MySQL database after computer reload system

Source: Internet
Author: User
Tags mysql in

How to recover after the computer re-loading system Mysql Database

One, "Set the path of MySQL"

For example: My MySQL in: D:\DataBase\mysql-5.7.13-winx64, you can re-create an environment variable in the environment variables mysql_home, the variable value is the MySQL installation directory

Then, the variable value in path is added;%mysql%\bin; ,

Second, "Testing"

Win+r, enter cmd, pop up the command Line window, enter the MySQL admin–v, if the following information appears, the configuration environment variable success!

Iii. "Changing Basedir and DataDir"

This step, mainly for you now the MySQL installation directory and before the change, if there is no change, input mysqld start MySQL after the other open a command line window, enter: mysql–u [user]–p [password] can login to MySQL, Then use show databases to find the database table or the original table! There's no change.

If unfortunately, you changed your MySQL installation directory, also very simple, in the MySQL installation directory has a file: My.ini

Open it

The discovery directory or the previous installation directory and database directory, you need to manually change to the current directory, if you do not have this file can be copied a copy of My-default.ini and renamed to My.ini, and then modify the corresponding content.

Iv. "Ultimate Test"

This is open command window, enter mysqld start MySQL after open additional window input mysql–u [user]–p [Password]

Connection Successful!

V. "Registering MySQL to system service"

This step, can do not do, if your MySQL is only used for personal play, there is no need, if it is as a server, or register as a system service, so when the system started to open the service, also very simple, open a command window, enter: mysqld install it! Open the service, found a more MySQL service, registration service success!

How to recover MySQL database after computer reload system

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.