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

MySQL transaction details

Table of contents Introduction Four characteristi...

The HTML 5 draft did not become a formal standard

<br />Yesterday I saw at W3C that the new HT...

Analysis of CocosCreator's new resource management system

Table of contents 1. Resources and Construction 1...

Install JDK1.8 in Linux environment

Table of contents 1. Installation Environment 2. ...

Example code of CSS responsive layout system

Responsive layout systems are already very common...

How to solve the problem that Seata cannot use MySQL 8 version

Possible reasons: The main reason why Seata does ...

Detailed explanation of identifying files with the same content on Linux

Preface Sometimes file copies amount to a huge wa...

Installation and use of mysql on Ubuntu (general version)

Regardless of which version of Ubuntu, installing...

Graphical explanation of the underlying principle of JavaScript scope chain

Table of contents Preface Scope 1. What is scope?...

mysql solves time zone related problems

Preface: When using MySQL, you may encounter time...

MySQL slow query and query reconstruction method record

Preface What is a slow query and how to optimize ...