24.2.SQLSTATE[HY000][2002]Nosuchfileordirectory
mysql> show variables like `%socket%`; +-----------------------------------------+---------------------------+ | Variable_name | Value | +-----------------------------------------+---------------------------+ | performance_schema_max_socket_classes | 10 | | performance_schema_max_socket_instances | -1 | | socket | /var/lib/mysql/mysql.sock | +-----------------------------------------+---------------------------+ 3 rows in set (0.02 sec)
檢視 php.ini 中的 pdo_mysql.default_socket 配置
# php -i | grep pdo_mysql.default_socket pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
開啟php.ini檔案將 pdo_mysql.default_socket 配置為 /var/lib/mysql/mysql.sock
重啟 php-fpm 後配置生效
systemctl restart php-fpm
原文出處:Netkiller 系列 手札
本文作者:陳景峰
轉載請與作者聯絡,同時請務必標明文章原始出處和作者資訊及本宣告。
相關文章
- Error!: SQLSTATE[HY000] [2002] Connection refusedErrorSQL
- ERROR2002(HY000):CantconnecttolocalMySQLserverthroughsocket的解決方法ErrorMySqlServer
- 連線資料庫提示sqlstate[hy000] [2002] Connection refused資料庫SQL
- MySQL5.6:mysql_secure_installation 報錯ERROR 2002 (HY000)MySqlError
- ERROR 2002 (HY000): Can't connect server socket /tmp/mysql.sockErrorServerMySql
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- [root@mastermysql]#mysql-uroot-pjsbERROR2002(HY000):Can'tconnecttolocalMySQLserverthroASTMySqlJSErrorServer
- ERROR 2002(HY000):Can't connect to local MySQL socket '/tmp/mysql.sock'ErrorMySql
- ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解決方法ErrorMySqlServer
- ERROR 2002 (HY000): Can't connect server socket /var/run/mysqld/mysqld.sockErrorServerMySql
- docker phpmyadmin 連線宿主mysql資料庫報錯:mysqli::real_connect(): (HY000/2002): Connection refusedDockerPHPMySql資料庫
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- ERROR 2002Error
- SQLSTATE[HY000] [1049] Unknown databaseSQLDatabase
- ERROR 1524 (HY000): Plugin is not loadedErrorPlugin
- NOIP 2002 字串變換字串
- ERROR 1114 (HY000) The table '' is fullError
- MYSQL ERROR 2003 (HY000) CanMySqlError
- Linux解決CentOS7關閉/開啟防火牆出現Unitiptables.servicefailedtoload:Nosuchfileordirectory.LinuxCentOS防火牆AI
- 更換mysql資料目錄後出現ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 的解決辦法MySqlErrorServer
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- ERROR 1290 (HY000) 解決辦法Error
- ERROR 1010 (HY000) mysql 5.5.19ErrorMySql
- FIN2002- Corporate FinanceNaN
- CSSE2002 java專案描述CSSJava
- CF2002 D1/2
- 【MySQL】ERROR 1878 (HY000): Temporary file write failure.MySqlErrorAI
- ERROR 1010 (HY000): Error dropping databaseErrorDatabase
- 2020024 - PHP 變數PHP變數
- BZOJ2976 : [Poi2002]出圈遊戲遊戲
- 萬能五筆2002分析筆記!筆記
- oracle11g ORA-32002Oracle
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- ERROR 1135 (HY000): Can't create a new threadErrorthread
- 【Mysql】ERROR 1872 (HY000): Slave failed to initialize relay log infoMySqlErrorAI
- ERROR 1168 (HY000): Unable to open underlying table which isError
- ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,ErrorFunctionNoneSQL
- 關於軟體的思考(2002.2.21) (轉)