Ask the MySQL Server for the data directory

Registered by Lenz Grimmer

Currently, one has to provide the volume group and logical volume name as well as the relative path manually on which the MySQL Server's data directory resides. It should it be possible to determine this automatically, by asking the server for the location of it's data directory and then querying the Operating system for the logical volume (or ZFS file system) this directory is stored on.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

mysql> show variables like 'datadir';
+---------------+----------------------+
| Variable_name | Value |
+---------------+----------------------+
| datadir | /var/lib/mysql/data/ |
+---------------+----------------------+
1 row in set (0.00 sec)

The only problem with this is that innodb files may be in another directory. (/var/lib/mysql/innodb)
You'd also want the binlogs (/var/lib/mysql/binlogs/), and all other relevant files (/var/lib/mysql/logs/, /var/lib/mysql/relaylogs/).

Just be sure to go up one dir from DataDir so that everything is included.

---

a.skwar:
Going up from datadir is no good. I have my datadir set to /data/mysql. Doing a tar of "/data/mysql/.." would include non-mysql data, but it would not even include binlogs and such.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.