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

Example code for implementing anti-shake in Vue

Anti-shake: Prevent repeated clicks from triggeri...

How to use Web front-end vector icons

Preface When writing front-end pages, we often us...

Steps to transplant the new kernel to the Linux system

1. Download the ubuntu16.04 image and the corresp...

Implementing custom radio and check box functions with pure CSS

1. Achieve the effect 2 Knowledge Points 2.1 <...

How to implement remote access control in Centos 7.4

1. SSH remote management SSH is a secure channel ...

Example code for implementing the "plus sign" effect with CSS

To achieve the plus sign effect shown below: To a...

How to change the root password in MySQL 5.7

Starting from MySQL 5.7, many security updates ha...

Scary Halloween Linux Commands

Even though it's not Halloween, it's wort...

HTML table only displays the outer border of the table

I would like to ask a question. In Dreamweaver, I...

React uses routing to redirect to the login interface

In the previous article, after configuring the we...

Detailed explanation of browser negotiation cache process based on nginx

This article mainly introduces the detailed proce...