Ubuntu 18 Install MySQL Server and Setup Full Backups

July 22, 2018

Install MySQL Server

Install the server and then you must configure the server.

sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation

Backup All Databases on the Server

mysqldump -A --lock-all-tables --routines --events --triggers --force > mysqldump.sql

This can be added as a cron job or as part of an rsnapshot rule for performing regular backups.

Restore the Backup File

mysql -u root -p < mysqldump.sql

Related Posts