Usually, this error does occur when you are using an incompatible PHP version with your current version of WordPress or if you are using the outdated version of WordPress. Changing the PHP version to a lower PHP version such as PHP 5.6 might solve this issue. Basically the cause of this issue is an outdated MySQL' extension which was depreciated from the PHP 7.0
To change the PHP version you can refer to the below article. Please refer to the Accuweb > Change PHP Version article inorder to change the PHP version from cPanel.
However, we will recommend using the upgraded version of WordPress and you can follow Accuweb > Upgrade Wordpress which will show you how to upgrade your WordPress version in few simple steps.