win2008 R2 Server to modify the Mysql 5.5 database data directory method _mysql

Source: Internet
Author: User
Tags mysql version

Description

Operating system: Windows Server 2008 R2

MySQL version: 5.5.25a

MySQL Program installation directory: D:\Program files\mysql\mysql Server 5.5

MySQL database default directory: C:\ProgramData\MySQL\MySQL Server 5.5\data\

Requirements: modify MySQL database directory for D:\Program files\mysql\mysql Server 5.5\data

Specific actions:

First, stop MySQL

Start-cmd

net stop mysql55

Second, copy the original database directory to the new directory

1, backup D:\Program files\mysql\mysql Server 5.5\ in the data directory for Data-bak

2, copy the data directory in C:\ProgramData\MySQL\MySQL Server 5.5\ to

D:\Program files\mysql\mysql Server 5.5\ Directory

System Yun-wei www.osyunwei.com warm reminder: qihang01 original content copyright, reproduced please indicate the source and the original link

Third, modify the MySQL configuration file

1, with Notepad to open the C:\ProgramData\MySQL\MySQL Server 5.5\data\ directory My.ini

Find datadir= "C:\ProgramData\MySQL\MySQL Server 5.5\data"

In front add # comment out

Add a row below

Datadir= "D:\Program files\mysql\mysql Server 5.5\data"

After the modification is complete, save the exit.

2. Copy 5.5\ to C:\Documents and Settings\All Users\Application Data\mysql\mysql Server My.ini Directory

D:\Program files\mysql\mysql Server 5.5\ Directory

Four, restart MySQL

1. Start-cmd

net start mysql55

2, into the MySQL console

Start-All Programs-mysql-mysql Server 5.5-mysql 5.5 Command line Client

Prompts to enter the MySQL root account password, enter after entering the MySQL console

Show variables like '%datadir% '; #查询MySQL数据库存放目录, as shown in the following figure

You can see that the MySQL database repository directory has been modified to D:\Program files\mysql\mysql Server 5.5\data

At this point, Windows Server 2008 R2 to modify the MySQL 5.5 database directory complete

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.