這些函數的行為受 php.ini 中的設置影響。
名字 | 默認 | 可修改范圍 | 更新日志 |
---|---|---|---|
mysqli.allow_local_infile | "0" | PHP_INI_SYSTEM | 自PHP 5.2.4起可用。在 PHP 7.2.16 和 7.3.3 之前,默認值為 "1" |
mysqli.local_infile_directory | PHP_INI_SYSTEM | ||
mysqli.allow_persistent | "1" | PHP_INI_SYSTEM | 自PHP 5.3.0起可用。 |
mysqli.max_persistent | "-1" | PHP_INI_SYSTEM | 自PHP 5.3.0起可用。 |
mysqli.max_links | "-1" | PHP_INI_SYSTEM | |
mysqli.default_port | "3306" | PHP_INI_ALL | |
mysqli.default_socket | NULL | PHP_INI_ALL | |
mysqli.default_host | NULL | PHP_INI_ALL | |
mysqli.default_user | NULL | PHP_INI_ALL | 自PHP 5.0.0起可用。 |
mysqli.default_pw | NULL | PHP_INI_ALL | |
mysqli.reconnect | "0" | PHP_INI_SYSTEM | |
mysqli.rollback_on_cached_plink | TRUE | PHP_INI_SYSTEM | 自 PHP 5.6.0 起可用。 |
關(guān)于前面出現的PHP_INI_*系列常量的詳細定義,請參閱配置的修改一章。
這是配置指令的簡(jiǎn)短說(shuō)明。
mysqli.allow_local_infile
integer
允許Mysql的Load Data語(yǔ)句訪(fǎng)問(wèn)PHP角度看的本地文件。
mysqli.local_infile_directory
string
限制加載 LOCAL DATA 文件為指定的目錄。
mysqli.allow_persistent
integer
開(kāi)啟使用mysqli_connect()函數創(chuàng )建持久化連接的能力。
mysqli.max_persistent
integer
可以創(chuàng )建的持久化連接的最大數量,設置為0表明不限制。
mysqli.max_links
integer
每個(gè)進(jìn)程中Mysql連接的最大數量。
mysqli.default_port
integer
當沒(méi)有指定其他端口號時(shí)使用的默認的用于連接數據庫服務(wù)器的TCP端口號。如果沒(méi)有設置默認值,
端口號將會(huì )按照順序從環(huán)境變量MYSQL_TCP_PORT
,/etc/services
文件中的mysql-tcp
條目或編譯期的MYSQL_PORT
常量等位置獲取。
Win32僅使用MYSQL_PORT
常量。
mysqli.default_socket
string
當連接到本地數據庫服務(wù)器時(shí)如果沒(méi)有指定其他socket名稱(chēng),使用的默認socket名稱(chēng)。
mysqli.default_host
string
當連接到數據庫服務(wù)器時(shí), 如果沒(méi)有指定其他主機地址,使用的默認服務(wù)器主機。
mysqli.default_user
string
當連接到數據庫服務(wù)器時(shí),如果沒(méi)有指定其他用戶(hù)名,使用的默認用戶(hù)名。
mysqli.default_pw
string
當連接到數據庫服務(wù)器時(shí),如果沒(méi)有指定其他密碼,使用的默認密碼。
mysqli.reconnect
integer
連接丟失時(shí)是否自動(dòng)重新連接。
注意: mysqlnd 驅動(dòng)會(huì )此忽略 php.ini 設置。
mysqli.rollback_on_cached_plink
bool
If this option is enabled, closing a persistent connection will rollback any pending transactions of this connection before it is put back into the persistent connection pool. Otherwise, pending transactions will be rolled back only when the connection is reused, or when it is actually closed.
用戶(hù)不能通過(guò)API調用或運行時(shí)配置來(lái)設置MYSQL_OPT_READ_TIMEOUT
。
注意,如果可能這樣做那么libmysqlclient
和流對MYSQL_OPT_READ_TIMEOUT
的值將會(huì )有不同的解釋。