mysqldump -u username -p databasename>databasename.sql.yyyy_MM_dd_hh_mm
SET GLOBAL max_allowed_packet=500*1024*1024;
set wait_timeout=28800000;
set interactive_timeout = 28800000;
mysql -u username -p<databasename.sql.yyyy_MM_dd_hh_mm
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'%' IDENTIFIED BY 'password';
SET GLOBAL max_allowed_packet=500*1024*1024;
set wait_timeout=28800000;
set interactive_timeout = 28800000;
mysql -u username -p<databasename.sql.yyyy_MM_dd_hh_mm
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'%' IDENTIFIED BY 'password';