MySQL将数据存储在硬盘中的什么位置?

在这里,我提供了一个简单的用户指南,以查找MySQL数据库在Windows和Linux中在哪里将数据存储在我们的硬盘中。

视窗

1)找到my.ini ,该文件存储在MySQL安装文件夹中。

例如,

C:\Program Files\MySQL\MySQL Server 5.1\my.ini

2)用我们喜欢的文本编辑器打开“ my.ini”。

#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.1/"

#Path to the database root
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"

找到“ datadir”,这是MySQL在Windows中存储数据的位置。

的Linux

1)找到与查找/ -name的my.cnf命令my.cnf中

yongmo@myserver:~$ find / -name my.cnf
find: /home/lost+found: Permission denied
find: /lost+found: Permission denied
/etc/mysql/my.cnf

2)查看my.cnf文件cat /etc/mysql/my.cnf

yongmo@myserver:~$ cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
[mysqld]
#
# * Basic Settings
#
user   = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket  = /var/run/mysqld/mysqld.sock
port   = 3306
basedir  = /usr
datadir  = /var/lib/mysql
tmpdir  = /tmp
language = /usr/share/mysql/english
skip-external-locking

3)找到“ datadir”,这是MySQL在Linux系统中存储数据的位置。

翻译自: https://mkyong.com/mysql/where-does-mysql-stored-the-data-in-my-harddisk/

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值