Why am I getting a PDO Exception error when I try to run Drupal Console inside the root directory? I've installed Drupal Console and can confirm it is in the proper directory, etc.

I run the command "Drupal" from my home directory and I see a Drupal Console help list of commands, but when I run it inside my site root directory, I get a PDO Exception error. I can't figure this one out. Should I move Drupal Console into my Drupal site directory? Thanks for the help.
Try to update below in your php.ini. You need to define php for correct location for .sock file.

mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock


OR

If you will not getting result then try to replace below in your settings.php file.

Replace 'host' =&gt; 'localhost',

With 'host' =&gt; '127.0.0.1',