dongshi2588 2018-08-09 15:18
浏览 76

MariaDB和PHP的SSL错误

I got a problem. I am trying to create an SSL connection between my MariaDB database and my PHP code. At the moment of making the connection it works well to a certain extent, since in the PHP errors I start to get the following error: MySQL Server has gone away and the number of failed attempts and connection abortions increase drastically.

This is my code:

$this->connection = mysqli_init();

mysqli_options($this->connection, MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);

$this->connection->ssl_set('/xxx/xxx/client-key.pem', '/xxx/xx/client-cert.pem', '/xx/xxx/ca-cert.pem', NULL, NULL);

if (!$this->connection->real_connect($this->host, $this->user_db, $this->password_db, $this->database, 3306, NULL, MYSQLI_CLIENT_SSL)) {
    $this->error_connect = $this->connection->connect_error;
    return false;
} else {
    $this->setCharset();
    return true;
}

What could be wrong with the server or my code?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器