It is a non-persistent connection function, while mysqli is a permanent connection function. That is to say, mysql will open a connection process each time it connects, and mysqli will use the same connection process to run mysqli multiple times, thus reducing the overhead of the server because of the recent time and the increase in website traffic, it has been plagued by the problem of full process occupation. Therefore, to reduce the process overhead, a set of mysqli driver is added to the mayfish framework. Next, let's take a look at how mayfish is a non-persistent connection function, while mysqli is a permanent connection function. That is to say
Mysql opens a connection process at each link, and mysqli runs mysqli multiple times to use the same connection process, thus reducing the server overhead.
Recently, the website has been plagued by the problem of full occupation of processes due to the increase in access traffic. Therefore, to reduce the process overhead, a set of mysqli driver is added to the mayfish framework. Next, let's take a look at how to use the mysqli driver in mayfish.
In the configs directory, modify the mysql settings file, for example, database.
See the following content. This is an example of using the mysql driver by default.
The Code is as follows:
Conf ('db _ host', 'localhost ');
Conf ('db _ user', 'root ');
Conf ('db _ password', '123 ');
Conf ('db _ name', 'u112741 ');
Conf ('db _ prefix', 'mfs _');
Conf ('db _ charset', 'utf8 ');
We changed it
The Code is as follows:
Conf ('driver ', 'mysqli ');
Conf ('db _ host', 'localhost ');
Conf ('db _ user', 'root ');
Conf ('db _ password', '123 ');
Conf ('db _ name', 'u112741 ');
Conf ('db _ prefix', 'mfs _');
Conf ('db _ charset', 'utf8 ');
In this case, mfs will work in mysqli mode during work.
In addition, this update also adds the error log function for query to facilitate debugging errors. To enable this function, modify the configs/config. php file: