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 aMyISAM
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)