mac下查找mysql的数据文件存储位置

mac下查找mysql的数据文件存储位置

sudo ls /usr/local/mysql/data/zss

sudo ls /usr/local/mysql/data/zss

zss: 库名称

使用命令查找

mysql> SHOW VARIABLES LIKE 'datadir';
+---------------+------------------------+
| Variable_name | Value                  |
+---------------+------------------------+
| datadir       | /usr/local/mysql/data/ |
+---------------+------------------------+
1 row in set (0.01 sec)

innoDB存储文件

innodb的主索引文件上 直接存放该行数据,称为聚簇索引

t1.frm

t1.ibd

MyISAM的存储文件

t3.frm

t3.MYI

.MYI file for a MyISAM table contains the table's indexes.

t3.MYD

MyISAM SQL Data file

.frm

不管您选择哪种存储引擎,您创建的每个MySQL表在磁盘上都由一个描述表格式(即表定义)的.frm文件表示。文件与表同名,扩展名为.frm。.frm格式在所有平台上都是相同的,但是在下面对.frm格式的描述中,示例来自在Linux操作系统下创建的表。(百度翻译)

Regardless of the storage engine you choose, every MySQL table you create is represented on disk by a .frm file that describes the table's format (that is, the table definition). The file bears the same name as the table, with an .frm extension. The .frm format is the same on all platforms, but in the description of the .frm format that follows, the examples come from tables created under the Linux operating system.(mysql官网 https://dev.mysql.com/doc/internals/en/frm-file-format.html

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。