Find MySQL data directory location
Question:
How to find MySQL data directory location? Answer:
SHOW VARIABLES WHERE Variable_Name = "datadir";
Description:
The datadir
MySQL system variable contains the path to the MySQL server data directory. Relative paths are resolved with respect to the current directory. If you expect the server to be started automatically, it is best to specify the datadir
value as an absolute path.
Reference:
datadir system variable reference
Share "How to find MySQL data directory location?"
Related snippets:
- Backup only certain rows from MySQL database
- Create INSERT statement for each record with mysqldump
- Backup MySQL database without locking tables
- Backup MySQL data only
- Skip tables in MySQL backup
- Backup only selected tables in MySQL
- Backup MySQL schema only
- Backup MySQL database
- Find MySQL data directory location
- List databases on MySQL server
- List all tables in a MySQL database
Tags:
mysql data directory, data directory location, show variables, datadir, mysql Technical term:
Find MySQL data directory location