mysql在哪里存储数据? [英] Where does mysql store data?

查看:101
本文介绍了mysql在哪里存储数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mysql在哪里存储数据?我发现(通过使用mysql> SELECT @@ datadir)它在var/lib/mysql中-但这不是.我有一个很大的数据库(4 GB),名为"bot",但是"bot"子目录(var/lib/mysql/bot)中的所有文件只有280KB.其余在哪里?

Where does mysql store data? I found out (by using mysql>SELECT @@datadir ) that it's in var/lib/mysql - but that can't be it. I have a quite big database (4 GB) called 'bot', but all the files in the 'bot' subdirectory (var/lib/mysql/bot) have only 280KB. Where is the rest?

还有一件事-数据库大小的99%是其中一个表中的文本列-我知道mysql将其存储在单独的文件中,但是每条记录会创建一个文件吗?

One more thing - 99% of the database's size is a text column in one of the tables - I know that mysql stores it in separate files, but does it create one file per record?

我在var/lib/mysql目录中找到一个大文件ibdata1-它的大小超过8GB-这是什么? (顺便说一句,在var/lib/mysql目录中也有其他数据库).

I found a big file in the var/lib/mysql directory named ibdata1 - its size is over 8GB - what is it? (btw, there are other databases as well in the var/lib/mysql directory).

推荐答案

在行与行之间进行读取-这是一个innodb数据库吗?在这种情况下,实际数据通常以ibdata1的名称存储在该目录中.除非您专门将mysql设置为使用每个表一个文件(

Reading between the lines - Is this an innodb database? In which case the actual data is normally stored in that directory under the name ibdata1. This file contains all your tables unless you specifically set up mysql to use one-file-per-table (innodb-file-per-table)

这篇关于mysql在哪里存储数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆