I installed MariaDB and failed to notice it replaces Mysql. During the install, it moved the Mysql data directory to mysql-5.7. I removed MariaDB and reinstalled Mysql and tried to restore my databases by simply moving them from mysql-5.7 to mysql and restarting Mysql. Mysql won't start again and therefore I cannot use mysqldump as suggested here - How to restore mysql databases after upgrading to mariadb. How can I restore my databases?
For reference, I am running Ubuntu Server 16.04 and Mysql 5.7.
The old data directory will be saved at new location. A file named /var/lib/mysql/debian-*.flag exists on this system. The number indicated a database binary format version that cannot automatically be upgraded (or downgraded). Therefore the previous data directory will be renamed to /var/lib/mysql-* and a new data directory will be initialized at /var/lib/mysql.
Since the only folders in /var/lib that match that are mysql-files and mysql-5.7 and mysql-files is empty, I assume the mysql folder was moved to mysql-5.7.