Location of the Data Directory

A default data directory location is compiled into the server. Typical defaults are /usr/local/var if you install MySQL from a source distribution, /usr/local/mysql/data if you install from a binary distribution, and /var/lib/mysql if you install from an RPM file.

The data directory location may be specified explicitly when you start up the server by using a --datadir= /path/to/dir option. This is useful if you want to place the data directory somewhere other than its default location.

As a MySQL administrator, you should know where your data directory is. If you run multiple servers, you should know where all the data directories are. But if you don't know the location (perhaps you are taking over for a previous ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.