Backup mysql configs and database
sudo tar cvfvz /backup/mysql_conf.tgz /etc/mysql sudo sh -c ‘mysqldump -u root -p -A –events > /backup/backup_db.sql’ sudo tar cvfvz /backup/mysql_data.tgz /var/lib/mysql
sudo tar cvfvz /backup/mysql_conf.tgz /etc/mysql sudo sh -c ‘mysqldump -u root -p -A –events > /backup/backup_db.sql’ sudo tar cvfvz /backup/mysql_data.tgz /var/lib/mysql
CREATE DATABASE testdatabase; CREATE USER ‘testuser’@’localhost’ IDENTIFIED BY ‘testpassword’; GRANT ALL PRIVILEGES ON testdatabase.* TO ‘testuser’@’localhost’;
mysqldump -u -p db table1 table2 table3
mysqlcheck -c databasename -uyourusername -pyourpassword