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

How to query whether the mysql table is locked

Specific method: (Recommended tutorial: MySQL dat...

How to use Dockerfile to build images in Docker

Build the image Earlier we used various images fo...

JavaScript implements page scrolling animation

Table of contents Create a layout Add CSS styles ...

Summary of solutions to common Linux problems

1. Connect Centos7 under VMware and set a fixed I...

HTML code that can make IE freeze

We simply need to open any text editor, copy the f...

CentOS7 firewall and port related commands introduction

Table of contents 1. Check the current status of ...

Websocket+Vuex implements a real-time chat software

Table of contents Preface 1. The effect is as sho...

How to use lazy loading in react to reduce the first screen loading time

Table of contents use Install How to use it in ro...

Docker volumes file mapping method

background When working on the blockchain log mod...

25 Vue Tips You Must Know

Table of contents 1. Limit props to type lists 2....

How to Change Colors and Themes in Vim on Linux

Vim is a text editor that we use very often in Li...

Understanding and example code of Vue default slot

Table of contents What is a slot Understanding of...

Detailed explanation of the adaptive adaptation problem of Vue mobile terminal

1. Create a project with vue ui 2. Select basic c...