Why is constructing PDO connection slow?

后端 未结 1 1522
星月不相逢
星月不相逢 2020-11-28 10:54

I\'m using PDO in my PHP application. It connects to a MySQL server on the same server:

$db = new PDO(mysql:host=localhost;dbname=test, $username, $password)         


        
相关标签:
1条回答
  • 2020-11-28 11:40

    I've been doing some googling, and after reading this thread, I changed localhost to 127.0.0.1. That solves the problem....

    0 讨论(0)
提交回复
热议问题