WAMP 的 MySQL 数据库文件位于何处?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2727920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where do the MySQL database files reside for WAMP?
提问by Abhishek
I'm just curious as I am beginning to learn PHP and MySQL, as to where the database and other files of MySQL reside on the hard drive. I have installed WAMP on a Windows XP SP2 platform.
我只是好奇,因为我开始学习 PHP 和 MySQL,关于 MySQL 的数据库和其他文件驻留在硬盘驱动器上的位置。我已经在 Windows XP SP2 平台上安装了 WAMP。
采纳答案by Pekka
Usually in the /mysql/data
directory of your WAMP installation. You'll recognize the location because every database has a folder with the same name there.
通常在/mysql/data
您的 WAMP 安装目录中。您将识别该位置,因为每个数据库在那里都有一个同名的文件夹。
You can change the location of the data directory using the datadir
setting in my.cnf
. It is often moved elsewhere to ensure the data there gets backed up regularly.
您可以使用 中的datadir
设置更改数据目录的位置my.cnf
。它经常被转移到其他地方以确保那里的数据得到定期备份。
回答by kv.
Explore variables from the output of following command:
从以下命令的输出中探索变量:
mysql> show variables like '%dir%'
;
mysql> show variables like '%dir%'
;
回答by Yugal Jindle
Data directories for mysql
database :
mysql
数据库的数据目录:
Generally,
一般来说,
Windows wamp setup
: mysql/data
Linux (Ubuntu) : /var/lib/mysql
Windows wamp setup
: mysql/data
Linux (Ubuntu) :/var/lib/mysql
Configured Location: [ my.cnf
configures it as datadir
]
配置位置:[my.cnf
配置为datadir
]
Linux :
Linux:
$ cat /etc/mysql/my.cnf | grep 'datadir'
Windows :
窗户:
Open mysql/my.cnf (search for `datadir` )
From mysql
prompt : ( mysql>
) [ PREFERRED WAY ]
从mysql
提示:(mysql>
)[首选方式]
mysql> show variable like 'datadir';
I suppose that covers pretty much all cases.
我想这几乎涵盖了所有情况。
回答by Alex Cheng
I am not sure about WAMP, but if you install MySQL manually it should reside somewhere along the lines of this path:
我不确定 WAMP,但如果您手动安装 MySQL,它应该位于沿着这条路径的某处:
C:\Program Files\MySQL\MySQL Server 5.1
回答by Sudeep
Use the following to find the data directory using SQL console:
使用以下命令使用 SQL 控制台查找数据目录:
show variables like 'datadir'
回答by Kyle Coots
If your on linux you can use:
如果您在 linux 上,您可以使用:
sudo find / mysql | grep mysql
On Ubuntu it stores its database files in /var/lib/mysql
在 Ubuntu 上,它把它的数据库文件存储在 /var/lib/mysql
回答by Caremy
wamp/bin/mysql/mysqlx.x.x/data
wamp/bin/mysql/mysqlx.xx/data