Categories
MySQL for Digital Marketing

mysqldump all databases

mysqldump --all-databases -u root -p > all-dbs.sql
Categories
MySQL for Digital Marketing

mysql check and optimize all table

mysqlcheck -c  -u root -p --all-databases
Categories
MySQL for Digital Marketing

List mysql database sort by size

cd /var/lib/mysql
sudo du --max-depth=1 -h | sort -h

In phpmyadmin

Categories
AWS Linode Linode vs AWS vs Google Cloud vs Azure MySQL for Digital Marketing

MySQL Full Server Migration with users and grants

# SSH to New DB Server
ssh db1.shopping.com

# Take dump
ssh ubuntu@old-db1.shopping.com 'mysqldump --all-databases -u root -p | gzip' | mysql -u root -p

References:

https://stackoverflow.com/questions/23519797/how-to-export-import-existing-user-with-its-privileges