How to find where MySQL data is being stored

Updated: 6th December 2022
Tags: sql mysql

bash

mysql -e "show variables like 'datadir'"

mysql

show variables like 'datadir'