Hi everyone, I have just updated to Wordpress 4.5 and I am using iTerm Build 2.9.20160313 with CP-CLI. I am having issues finding a database connection.
I understand there was an issue initially with WP 4.5 and the way they were changing how wp-cli worked but this is a new error message. Here is what I am getting when trying to do a normal wp core update:
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Users/usr/Business/Development/site/core/wp-includes/wp-db.php on line 1489
Warning: mysql_connect(): No such file or directory in /Users/usr/Business/Development/site/core/wp-includes/wp-db.php on line 1515
Error: Error establishing a database connection
Is there anything I can do to get this working?
I am using Mamp Pro using PHP7 if this helps.
Thank you in advance
Can you share the contents of your wp-config.php file, minus any secrets?
And, just to confirm, you've configured WP-CLI to use the appropriate PHP binary?
Thank you Daniel, adding the extra line to the bash profile seemed to do the trick! Not 100% sure why it stopped working all of a sudden.
@dsgnr What extra line did you add? I'm having the same issue.
if you use MAMP , you should set the latest PHP version provided by MAMP and do not use the default PHP binary.
see : https://make.wordpress.org/cli/handbook/installing/#using-a-custom-php-binary
Most helpful comment
if you use MAMP , you should set the latest PHP version provided by MAMP and do not use the default PHP binary.
see : https://make.wordpress.org/cli/handbook/installing/#using-a-custom-php-binary