Hello,
I checked php -i | grep pdo and noticed this line:
pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
But, in my /etc/my.cnf the sock file is actually in /var/run/mysqld/mysqld.sock.
So, I opened up my php.ini and set the value for pdo_mysql.default_socket:
pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock
Then, I restarted apache and checked php -i | grep pdo:
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
That fixed it for me.
Hope this works fine!
Thank You!