默认情况下,CentOS 7上MySQL / MariaDB的存储位置在哪里?

Where is MySQL / MariaDB storage location by default on CentOS 7? No special configuration to the MariaDB from official repository of CentOS.

默认情况下,CentOS 7上MySQL / MariaDB的存储位置在哪里? 从CentOS的官方存储库对MariaDB无需特殊配置。

On CentOS 7 Linux it is usually by default

在CentOS 7 Linux上 ,通常默认情况下

/var/lib/mysql

But here I give you another “hacky” way to find it out.

但是在这里,我为您提供了另一种“ hacky”方法来发现它。

The method is to find out the mysql daemon mysqld’ opened files and the paths because it must open the files to read/write data.

该方法是找出mysql守护程序mysqld'打开的文件和路径,因为它必须打开文件才能读取/写入数据。

First, find out the process ID of the mysqld process:

首先,找出mysqld进程的进程ID:

# ps aux | grep mysqld

mysql    25403  1.0 17.2 1322220 174948 ?      Ssl  Aug31 178:10 /usr/sbin/mysqld

Second, go to the mysqld process’ dir under /proc/. For the above example,

其次,转到/proc/下的mysqld进程的目录。 对于以上示例,

# cd /proc/25403/

Check the opened files under the directory fd:

检查目录fd下打开的文件:

# ls fd -lha

An example is as follows for some files:

某些文件的示例如下:

lrwx------. 1 mysql mysql 64 Sep 12 11:43 83 -> /var/lib/mysql/my_wp2/wp_links.MYI
lrwx------. 1 mysql mysql 64 Sep 12 11:43 84 -> /var/lib/mysql/my_wp2/wp_links.MYD

You get the path for the directory to storing the database data files.

您将获得用于存储数据库数据文件的目录的路径。

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/where-is-mysql-mariadb-storage-location-by-default-on-centos-7/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值