MySQL server has gone away Docker

OS: centos 8 (mysql 8)

Two docker containers:

  1. MariaDB 10.3 (the database we are indexing)
  2. manticore
    docker run --restart=always --name manticore -p -p -p -d manticoresearch/manticore

Database index it works
docker exec -it manticore gosu manticore indexer --all --rotate

But connecting via php to manticore - does not work

$m = mysqli_connect('', '', '', '', 9306);

I have error: MySQL server has gone away

How to fix it?

If you started it like this

docker run --restart=always --name manticore -p -p -p -d manticoresearch/manticore

the indexer command should have failed:

➜  ~ docker exec -it manticore gosu manticore indexer --all --rotate
Manticore 3.5.4 13f8d08d@201211 release
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (
Copyright (c) 2017-2020, Manticore Software LTD (

using config file '/etc/manticoresearch/manticore.conf'...
FATAL: no indexes found in config file '/etc/manticoresearch/manticore.conf'

If you started it differently (i.e. had some custom config) please provide it.

To me your script works just fine:

➜  ~ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                                                         NAMES
7814db45e82e        manticoresearch/manticore   "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes>9306/tcp,>9308/tcp,>9312/tcp, 9315-9325/tcp   manticore
➜  ~ cat yr4ik.php
$m = mysqli_connect('', '', '', '', 9306);
$res = $m->query("show status");
while ($row = $res->fetch_assoc()) print_r($row);

➜  ~ php yr4ik.php|head
    [Counter] => uptime
    [Value] => 139
    [Counter] => connections
    [Value] => 3