The Kohana version I use is 2.3.1.
Although the socket interface is left in the database configuration, this socket is still not used after configuration.
You have to modify the Framework Code as follows (in bold ):
System/libraries/drivers/Database/Mysql. php (mysql driver ):
// Build the connection info
// $ Host = isset ($ host )? $ Host: $ socket;
$ Port = isset ($ port )? ':'. $ Port :";
// Add by Hily to support unix domain socket
$ Port = isset ($ socket )? ':'. $ Socket: $ port;
System/libraries/drivers/Database/Mysqli. php (mysqli driver ):
// Build the connection info
// Modified by Hily
// $ Host = isset ($ host )? $ Host: $ socket;
// Make the connection and select the database
// Add $ socket param by Hily
If ($ this-> link = new mysqli ($ host, $ user, $ pass, $ database, $ port, $ socket ))
Seriously suspect that the Kohana development team has used MySQL and has made such a low-level error.
Author: original Hily link:Http://hily.me/blog/2009/02/kohana-mysql-unix-domain-socket/
Copyright statement: You can reprint the document. You must use a hyperlink to indicate the original source, author information, and copyright statement of the document.