I tried googling to get the MySql path, but it was unsuccessful. Is there a unix command, where I can find the MySQL database directory path?
Try this query,
SHOW VARIABLES LIKE 'datadir';
Find the my.cnf and then find the datadir
sudo find / -name "my.cnf" | xargs cat | grep "datadir" | cut -d" " -f2
or if you know the location of the configuration file
cat /etc/mysql/my.cnf | grep "datadir" | cut -d" " -f2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With