PDOException SQLSTATE[HY000] [2002] No such file or directory How to fix and why this is happening?

Someone can explain what's going on here ? Where to customize and where ?
Do the following checks ..

Check php.ini -> Section Pdo_mysql and mysql :
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket=/tmp/mysql.sock

Check php -i | grep pdo in poppy bouquet :
pdo_mysql.default_socket => /var/mysql/mysql.sock => /var/mysql/mysql.sock

Check etc/my.cnf :
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

Check show variables like '%socket%' = /tmp/mysql.sock

Code:
$db = new PDO("mysql:host=localhost;dbname=users;port=3306",'root','plemia198800@@');
 print_r($db);
June 14th 19 at 18:16
0 answer

Find more questions by tags MySQLPHP PDOPHP