How to Retrieve MySQL Server Info via mysqli::$server_info When Connection Fails?
When using PHP’s mysqli extension to connect to a MySQL database, connection failures are quite common. Typically, we check the connection error code and message to determine the root cause. However, sometimes we also want to retrieve some server information—like the MySQL server version—to assist in diagnosis.
mysqli::$server_info