Move MySQL database to another disk under Windows

Move MySQL database to another disk under Windows

Preface

Today I installed MySQL and found that the database storage was installed on the C drive by default. Since the C drive has limited space, I wanted to move it to another drive.

Here are my steps

1. Start

2. Enter your password

 

3. Enter the command to query where the data is stored

show global variables like "%datadir%";

4. Move the Data file under C:\ProgramData\MySQL\MySQL Server 8.0 to the desired location

5. Modify the my.ini file under C:\ProgramData\MySQL\MySQL Server 8.0

Find datadir, add # to the original address and comment it out, then write the address of the data file you moved

6. Open Computer Management, find the MySQL service, and restart it

7. Check the data storage location again

show global variables like "%datadir%";

If the data position after the move is displayed, it means it is successful.

This is the end of this article about moving MySQL database to another disk under Windows. For more relevant MySQL database movement content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to move mysql5.7.19 data storage location in Centos7

<<:  Mobile web screen adaptation (rem)

>>:  CSS to achieve fast and cool shaking animation effect

Recommend

Introduction to cloud native technology kubernetes (K8S)

Table of contents 01 What is Kubernetes? 02 The d...

Complete list of CentOS7 firewall operation commands

Table of contents Install: 1. Basic use of firewa...

CentOS 6 Compile and install ZLMediaKit analysis

Install ZLMediaKit on centos6 The author of ZLMed...

MySQL deduplication methods

MySQL deduplication methods 【Beginner】There are v...

JavaScript Timer Details

Table of contents 1. Brief Introduction 2. setInt...

A brief summary of vue keep-alive

1. Function Mainly used to preserve component sta...

Detailed explanation of how to adjust Linux command history

The bash history command in Linux system helps to...

React example of how to get the value of the input box

React multiple ways to get the value of the input...

Mysql database index interview questions (basic programmer skills)

Table of contents introduction Indexing principle...

Web page production TD can also overflow hidden display

Perhaps when I name this article like this, someon...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

The core process of nodejs processing tcp connection

A few days ago, I exchanged some knowledge about ...

CSS beginner tutorial: background image fills the entire screen

If you want the entire interface to have a backgr...