Mysql-configuration-how does php connect to mysql?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.