We may have a doubt, that is: after we installed MySQL locally (on our own computer), we also created a lot of databases, tables, and stored a lot of data, but these contents are all Where is it stored? In particular, when we need to directly operate these data files, we have searched the entire computer but cannot find where the MySQL data files are. This is a bit cheating! This article mainly introduces in detail how to view the storage location of MySQL data files. It has certain reference value and interested friends can refer to it.
Here, I will teach you a very simple method to immediately locate the storage location of the MySQL data file, that is, type the following command on the MySQL client:
show global variables like "%datadir%";
#As shown in the figure above, MySQL data files are stored in the Data directory. As for whether you want to check the specific database or table next, it depends on your mood!
But you may still have a question, that is, we have all found that the MySQL data files are in the ProgramData directory of the C drive, but we have searched the entire C drive and still cannot find the ProgramData folder. This is Why? The answer is: By default, the ProgramData folder is hidden.
As for how to display hidden folders, I believe everyone has already played it very well!
Related recommendations:
PHP’s method of caching based on file storage, _PHP tutorial
MySQL specifies the data file storage path DATA DIRECTORY and INDEX DIRECTORY
mysql cluster uses disk file storage tables
The above is the detailed content of How to view the storage location of MySQL data files. For more information, please follow other related articles on the PHP Chinese website!