I updated my PHP from 5.4 to 7 and after that my wordpress website cannot connect to the database.
When I put the line define('WP_ALLOW_REPAIR', true);
within the wp-config.php and go to address: http://www.address.com/wp-admin/maint/repair.php
I still have the same error
Error establishing a database connection
When I connect to my wp-admin, I got the following:
Finally I checked my credential on my database within wp-config.php, they are correct but when I do a mysql> show databases;
I got the following:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)