簡體   English   中英

以下 PHP MySQLi init 的最大線程限制是多少?

[英]What is the maximum limit of thread for the following PHP MySQLi init?

站點范圍使用以下單個語句來調用數據庫連接,了解該代碼已包含在所有其他 php 文件中。 似乎它將達到限制,因為我檢查 RDS 端是否為多個用戶提供單一連接。 如何找出線程的最大限制? 或最大共享池?

unset($db1);
$db1 = new MySQLi($db_url,$db_username,$db_password,$db_name,$db_port);
$db1->query("set names utf8");

更好的選擇是更改配置中的這 3 個設置。

mysql> help set names;
Name: 'SET NAMES'
Description:
Syntax:
SET NAMES {'charset_name'
    [COLLATE 'collation_name'] | DEFAULT}

This statement sets the three session system variables
character_set_client, character_set_connection, and
character_set_results to the given character set. Setting
character_set_connection to charset_name also sets collation_connection
to the default collation for charset_name. See
https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html.

The optional COLLATE clause may be used to specify a collation
explicitly. If given, the collation must one of the permitted
collations for charset_name.

charset_name and collation_name may be quoted or unquoted.

The default mapping can be restored by using a value of DEFAULT. The
default depends on the server configuration.

Some character sets cannot be used as the client character set.
Attempting to use them with SET NAMES produces an error. See
https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html#charset
-connection-impermissible-client-charset.

URL: https://dev.mysql.com/doc/refman/8.0/en/set-names.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM