Drupal db backup

this command will clean cache tables
drush cc all

this command do an actual database backup
drush sql-dump > /path/to/filename.sql

grant acces to write for user:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON mydb.* TO 'myuser'@'localhost' IDENTIFIED BY 'mysecret';

flush privileges;