Function name: mysqli_driver::embedded_server_end()
Applicable version: PHP 5 >= 5.4.0, PHP 7, PHP 8
Usage: the mysqli_driver::embedded_server_end() method is used to shut down an embedded server. Embedded Server is a lightweight MySQL server that allows access and management of MySQL databases through PHP without a standalone MySQL server installed.
Example:
<?php // 设置嵌入式服务器的选项$driver = new mysqli_driver(); $driver->embedded_server_start(); // 连接到嵌入式服务器$mysqli = new mysqli('localhost', 'root', '', '', null, '/path/to/mysql.sock'); // 执行SQL查询等操作// 关闭嵌入式服务器mysqli_driver::embedded_server_end(); ?>
In the above example, we first start the embedded server through embedded_server_start()
method of mysqli_driver
class. Then we use mysqli
class to connect to the embedded server and perform some SQL operations. Finally, we use embedded_server_end()
method of mysqli_driver
class to close the embedded server.
Please note that after shutting down the embedded server, no operations related to the server will be performed anymore. This means that after calling embedded_server_end()
method, mysqli
object will no longer be used to connect, query, or manage the embedded server. If you need to reuse the embedded server, you need to call embedded_server_start()
method again to start it.