Find extension=mysqli and extension=pdo_mysql then uncomment.
Error connecting to the database: No such file or directory
ERROR --> Error connecting to the database: No such file or directory
CRITICAL --> Unable to connect to the database.
Main connection [MySQLi]: No such file or directory
Fix
Edit /etc/php/php.ini
Find pdo_mysql.default_socket and set its value to /var/mysql/mysql.sock