A.2. 配置

Since MySQL Version 3.22, read default startup options for the server and for clients from option files. Location: /etc/my.cnf, DATADIR/my.cnf, or ~/.my.cnf on Unix, windows-system-directory\my.ini,c:\my.cnf or C:\mysql\data\my.cnf on Windows.

注意 my.cnf 中关于 socket 的设置,如果设置和php识别的不一致,会导致以 unix socket访问数据库失败。建议采用TCP/IP方式建立连接: 即在建立连接时,host填写IP地址,如果是本机,使用127.0.0.1(TCP/IP),而不使用localhost(Unix Socket)。