I had a VM with apache and mysql installed and databases. Due to unforseen circumstances i had to rebuild the VM. The original / drive now is mounted on another VM as a disk. I would love to take my databases from there. I cannot find anywhere were the database files are located so i can move them. on the internet it mentions /var/lib/mysql but this folder is empty.
check the file “/etc/my.cnf”. If that contains a definition like “datadir = PATH_TO_YOUR_DATABASE” you will find the database files under “PATH_TO_YOUR_DATABASE” otherwise the default is used (which is “/var/lib/mysql”). To make sure you have sufficient rights to see/move the database files, you should look for them as “root”.
If you look in /var/lib/mysql on the other VM, and that folder’s empty, this just means that VM is not running mysql at all. You have to look beyond the mountpoint where you mounted the original VM as a disk. Your databases should be in MOUNTPOINT/var/lib/mysql