The above error occurs when you have updated the PHP Version on your server. To fix this please follow the below steps and have this error resolved in less than 2 minutes.
1. Login to WHM as root
2. Select Easy Apache
3. Select Customize in Currently Installed Packages as shown below
4. Now select PHP Extensions and in the search option type mysql. After this you will be able to see all the mysql extensions available for all the php versions. Now select install as shown below:
5. After selecting install of the mysql extension, click Next and go to the last section (Review). Scroll down and select Provision.
The above will solve the error for your WordPress site.