Skip to content

Instantly share code, notes, and snippets.

@emrahoruc
Last active April 14, 2022 20:26
Show Gist options
  • Save emrahoruc/5121dde0bdc1a34488a367edb0b1a73c to your computer and use it in GitHub Desktop.
Save emrahoruc/5121dde0bdc1a34488a367edb0b1a73c to your computer and use it in GitHub Desktop.
MySql Some Command linses
# Export
mysqldump -u root site_database > /home/sitename/BCKP001.sql
mysqldump -u root site_database | gzip > /home/sitename/BCKP001.sql.gz
# Ignore specific table
mysqldump -u root site_database --ignore-table=site_database.table1 > /home/sitename/BCKP001.sql
# Export specific table
mysqldump -u root site_database table1 > /home/sitename/BCKP001.sql
# Import
mysql -u root site_database < /home/sitename/BCKP001.sql
zcat /home/sitename/BCKP001.sql.gz | mysql -u root site_database
gunzip /home/sitename/BCKP001.sql.gz | mysql -u root site_database
# kill a specific mysql query
mysqladmin processlist
mysqladmin kill <query_id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment