Modify the database storage master path in MySQL

Source: Internet
Author: User

First stop the MySQL service.

Two. Change the database storage master path in MySQL configuration file My.ini

Open the My.ini file in the folder C:\ProgramData\MySQL\MySQL Server 5.7,

Locate datadir= "C:/programdata/mysql/mysql Server 5.7/data", which is the default database storage master path setting.

Now change it to D:/program files/data (note the backslash "/")

Click "File" on the menu bar and click "Save" when you are done.

Three. Copy the database files and folders from the old database storage master path to the new storage master path

Copy all the files and folders in the C:/programdata/mysql/mysql Server 5.7/data folder to your new folder directory.

Four. Restart the MySQL service

Five. Verify that the operation to change the database storage master path is successful

Show global variables like "%datadir%";

Modify the database storage master path in MySQL

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.