mysql - What is the maximum limit of thread for the following PHP MySQLi init?
Get the solution ↓↓↓Site wide is using the following single statement to call for DB connection, Understand that the code is included by all the other php files. Seems like it will be reaching a limit, because i check the RDS side is having single connection for multiple users. How can i find out the maximum limit of threads? or max sharing pool?
unset($db1);
$db1 = new MySQLi($db_url,$db_username,$db_password,$db_name,$db_port);
$db1->query("set names utf8");
Answer
Solution:
A better option would be to change those 3 settings in your config.
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
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: trying to access array offset on value of type bool in
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.