如何解决以下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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。