In high-performance mysql, we can see one sentence: & quot; each client connection will have a thread in the server process, and the query of this connection will only be executed in this separate thread, this thread can only run in a cpu core or cpu in turn. & Quot; when php connects to mysql, the user name is root, and... in "high-performance mysql", we can see a sentence: "Each client connection will have a thread in the server process, and the query of this connection will only be executed in this separate thread, this thread can only run in a cpu core or cpu in turn. "
When php connects to mysql, the user name is root, and multiple users access the database through the php website.
Is it true that a client (php client) accesses the database, or is it true that multiple clients (multiple users) access the database?
Reply content:
In "high-performance mysql", we can see a sentence: "Each client connection will have a thread in the server process, and the query of this connection will only be executed in this separate thread, this thread can only run in a cpu core or cpu in turn. "
When php connects to mysql, the user name is root, and multiple users access the database through the php website.
Is it true that a client (php client) accesses the database, or is it true that multiple clients (multiple users) access the database?
I think it is indeed implemented by the php extension of mysql. the mysql client in the extension processes the requests to the mysql server in the extension.
This depends on how the MySQL driver of PHP implements the connection. The connection to MySQL is generally not directly implemented by PHP, but through the MySQL extension of PHP, mySQL extensions generally provide the persistent connection function, which is independent of the lifecycle of a single PHP request, that is to say, multiple request processes can share the same connection (or multiple connections). The number of clients requesting PHP is not always equal to the number of clients requesting MySQL.