If you're working with legacy code, it's possible to install the MySQL extension in PHP 7 if you really need it, but it's deprecated and removed in PHP 7, but still possible to compile PHP to include it, although a pain to achieve. Either way, best to rewrite code to use either MySQLi or PDO instead.
If you don't have the time to do refactoring, and don't have the time to get the deprecated and removed MySQL extension into PHP, you can also try using code that emulates the MySQL extension using the MySQLi extension:
https://github.com/e-sites/php-mysql-mysqli-wrapper
https://github.com/kijin/mysql-compat
I've used such code before in the past in conjunction with auto_prepend_file
to get a whole legacy codebase onto PHP 7 without spending much time refactoring code lacking tests, etc. The idea behind doing it with auto_prepend_file is in case the legacy code has multiple entry points to save you from editing several files in the codebase so it's always available. One drawback of such approaches is that code which explicitly checks for the MySQL extension to be loaded will fail to detect the extension, such has been my experience with certain Wordpress versions.
All that said, if you lack the time, try to convince whoever you're working for, or yourself, that it's worthwhile swapping over to either MySQLi or PDO and taking the time to refactor code, etc.