Install libpam-mysql by entering the following commands in the terminal:
sudo apt update sudo apt install libpam-mysql
PAM module interfacing with MySQL databases
This module lets PAM-enabled applications get authentication and account information from MySQL databases. Passwords can be stored in various encrypted formats, for example as crypt, MD5 or SHA1 hashes, in MySQL format or in the Drupal 7 salted format. Account and password expiration is handled via SQL expressions. Logging into MySQL is also supported.