Where does MySQL stores the data in the harddisk?
by Rekha[ Edit ] 2009-11-16 11:47:23
In Windows
1) Locate the my.ini, which store in the MySQL installation folder.
For Example,
C:Program FilesMySQLMySQL Server 5.1my.ini
2) Open the "my.ini" with our favourite text editor.
#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/"
Find the "datadir", this is the place where MySQL stores the data in Windows.
In Linux
1) Locate the my.cnf with the find / -name my.cnf command.
/etc/mysql/my.cnf
2) view the my.cnf file cat /etc/mysql/my.cnf
~$ 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) Find the "datadir", this is the place where MySQL stores the data in Linux system.