To change the location of the MySQL database data store

Source: Internet
Author: User

First, the MySQL service first stop, change the MySQL configuration file My.ini in the database storage master path, the old database storage master path of the database files and folders copied to the new storage master path, and then restart the fix.

First stop the MySQL service.

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

Open the MySQL default installation folder C:\Program My.ini file in Files\mysql\mysql Server 5.1, click "Edit", "find" at the top of Notepad, enter DataDir in the Find content and click "Find Next" to "go to" Path to the database root databases store the main path "parameter settings, find Datadir=" C:/Documents and Settings/all users/application data/mysql/mysql Server 5.1/data/"is the default database store master path setting, now change it to the C:\mysql\data (you want) folder, the correct setting is Datadir=" c:/mysql/data/".

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:/Documents and Settings/all users/application data/mysql/mysql Server 5.1/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

To change the location of the MySQL database data store

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.