Tuesday, October 7, 2014

Where does MySQL store data in PC


Windows

Find the my.ini file which store in the MySQL installation folder.
and then open the file and Find the “datadir”, this is the where does MySQL stored the data in Windows.
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"

Linux

Find the my.cnf with the sudo find / -name my.cnf command.
2) viewthe my.cnf file 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) Find the “datadir”, this is where does MySQL stored the data in Linux system. 

No comments:

Post a Comment