$mysql -u[UserID] -p[Password] -e'SHOW VARIABLES LIKE "datadir"'
+---------------+-----------------------+
| Variable_name | Value |
+---------------+-----------------------+
| datadir | /usr/local/var/mysql/ |
+---------------+-----------------------+