How to view the storage location of MySQL data files

How to view the storage location of MySQL data files

We may have a question: After we install MySQL locally (on our own computer), we create many databases and tables and store a lot of data, but where are these contents stored? In particular, when we need to directly operate these data files, we search the entire computer but cannot find where the MySQL data files are. This is a bit annoying!

Here, I will teach you a very simple method to immediately locate the storage location of MySQL data files, that is, type the following command in the MySQL client:

show global variables like "%datadir%";

8

As shown in the figure above, MySQL data files are stored in the Data directory. As for whether you want to check a specific database or table next, it depends on your mood!

However, you may still have a question. We have found that the MySQL data files are in the ProgramData directory of the C drive, but we have searched the entire C drive but still cannot find the ProgramData folder. Why is that? The answer is: by default, the ProgramData folder is hidden .

As for how to display hidden folders, I believe everyone has already done it well!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of MySQL file storage

<<:  Detailed explanation of Nginx's connection limit configuration for IP addresses in a network segment

>>:  Mini Program to Implement Slider Effect

Recommend

Detailed explanation of the binlog log analysis tool for monitoring MySQL: Canal

Canal is an open source project under Alibaba, de...

Quickly solve the problem of slow Tomcat startup, super simple

Today I helped a classmate solve a problem - Tomc...

How to set PATH environment variable in Linux system (3 methods)

1. In Windows system, many software installations...

MySQL replication mechanism principle explanation

Background Replication is a complete copy of data...

Causes and solutions for MySQL too many connections error

Table of contents Brief summary At noon today, th...

Solution to the long delay of MySQL database master-slave replication

Preface The delay of MySQL master-slave replicati...

Detailed tutorial on installing and configuring MySql5.7 on Ubuntu 20.04

Table of contents 1. Ubuntu source change 2. Inst...

A brief discussion on several specifications of JS front-end modularization

Table of contents Preface The value of front-end ...

MySQL Router implements MySQL read-write separation

Table of contents 1. Introduction 2. Configure My...

About the problem of offline installation of Docker package on CentOS 8.4

The virtual machine used is CentOS 8.4, which sim...

Some suggestions for Linux system optimization (kernel optimization)

Disable swap If the server is running a database ...

What does this.parentNode.parentNode (parent node of parent node) mean?

The parent node of the parent node, for example, t...

Steps to use ORM to add data in MySQL

【Foreword】 If you want to use ORM to operate data...

Using zabbix to monitor the ogg process (Linux platform)

The ogg process of a database produced some time ...