You can also take dump of all database in single file using below command,
$ mysqldump -u root -p --all-databases | gzip -9 > alldatabases.sql.gz
3. Add Repository for Mysql 5.6
Now we are going to add the repository for latest MySQL version. Run below command in the terminal which helps you to download the repository file on the system.
$ wget -O mysql-apt-config.deb https://dev.mysql.com/get/mysql-apt-config_0.3.7-1debian8_all.deb
After downloading the file, use below "dpkg" command to install .deb file.
$ dpkg -i mysql-apt-config.deb
When you run above command, it will prompt you to choose MySQL version from 5.6 and 5.7. Choose any one as per your requirement. Refer below screens, so you will get the idea to choose MySQL version.