![]() ![]() A few answers suggest changing localhost to a local IP like 127.0.0.1 but that didn’t seem to fully resolve the issue for me, which lead me back to MAMP and MySQL Workbench.īased on the in-depth answers on Stack Overflow, it looks like this PHP class would expect SQL to be running on its default port, which is typically 3306. I didn’t get into the weeds of what is actually happening at the system level, since I really just wanted a cleaner way to start of a new theme. I found a few answers here and here that explain the essence of the issue is that the PHP mysqli_real_connect() class is trying to access the underlying UNIX socket in a way that doesn’t play well with localhost. After checking that everything was running and I hadn’t swapped any ports in MAMP, I went out to Stack Overflow. I had been messing with my local databases all morning, so I figured this was something I had screwed up. This could mean your host’s database server is down. This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `127.0.0.1`. ![]() The stack trace of the error started off with something link the following error message kicked out by PHP: PHP Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /path/to/wordpress/wp-includes/wp-db.php on line 1531Īnd then it ended with a friendlier, but a bit less helpful error from WP CLI: Error: Error establishing a database connection. It was easy enough to install, but I got a series of errors after running the following command: wp scaffold _s I decided to play around with WP CLI to scaffold out the theme for a project that we are starting, but ran into a few configuration issues. This will be a short post, but I felt it necessary to do since I had to deal with this is a non-standard way given my situation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |