Modify MYSQL 5.5 Database Data directory _mysql under Windows Server 2003

Source: Internet
Author: User
Tags mysql version

Description

Operating system: Windows Server 2003

MySQL version: 5.5.25

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

MySQL Database directory: C:\Documents and Settings\All Users\Application Data\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-run-cmd

net stop mysql55

Second, copy the original database storage 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 the C:\Documents and Settings\All Users\Application Data\mysql\mysql Server 5.5\ to

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

Third, modify the MySQL configuration file

1, with Notepad open C:\Documents and Settings\All Users\Application Data\mysql\mysql Server 5.5\ Directory

My.ini

Find Datadir= "C:\Documents and Settings\All Users\Application Data\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 change 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-run-cmd

net start mysql55

2, into the MySQL console

Start-Program-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 2003 modifies the MySQL 5.5 database directory to complete

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.