05-22-2020, 06:56 PM
Good job but this is more of a tutorial for/about "how to mount partitions in Linux via command line" based on something you had to do to achieve a goal and what you did to get to it. There is nothing about doing the backup of the MySQL databases.
Well, you did mention the path where the database files are usually stored:
- /var/lib/mysql usually ALWAYs contains the database files (mind the "usually" since you can change the path but that path is the default).
- /etc/mysql (and similar) is just the folder with the MySQL database server configuration files and you won't find the databases there.
Backing up the database files by copying them from /var/lib/mysql is a bit of a last resort usually. Depending on how the database server was shutdown the files might be "unclean" as the shutdown was not clean/proper. If you import that into a new server you might run into some issues. Just need to be careful.
To backup it up properly you could rebind the local /var/lib/x to /var/lib/x on the drive you are trying to backup, then install MySQL and do a clean start of it to get the database checked and such and after that run a mysqldump. However that is more advanced than it sounds like for most users.
Well, you did mention the path where the database files are usually stored:
- /var/lib/mysql usually ALWAYs contains the database files (mind the "usually" since you can change the path but that path is the default).
- /etc/mysql (and similar) is just the folder with the MySQL database server configuration files and you won't find the databases there.
Backing up the database files by copying them from /var/lib/mysql is a bit of a last resort usually. Depending on how the database server was shutdown the files might be "unclean" as the shutdown was not clean/proper. If you import that into a new server you might run into some issues. Just need to be careful.
To backup it up properly you could rebind the local /var/lib/x to /var/lib/x on the drive you are trying to backup, then install MySQL and do a clean start of it to get the database checked and such and after that run a mysqldump. However that is more advanced than it sounds like for most users.
![[Image: zHHqO5Q.png]](https://i.imgur.com/zHHqO5Q.png)