Lost connection to MySQL server at 'handshake: reading initial communication packet'

Hi All,
I am trying to run linuxserver/mariadb as docker on raspberrypi 4. I am using following command:

sudo docker run --volume /var/lib/mysql:/var/lib/mysql --volume /etc/mysql:/etc/mysql --name mariadb-server -p 3307:3306 -e "MYSQL_ROOT_PASSWORD=password" -d linuxserver/mariadb

It seams to be OK when I am checking it with:

docker ps -a

But when I am trying to access database using:

 mariadb -h 127.0.0.1 --port 3307 -u root -p

I am getting following message :

ERROR 2013 (HY000): Lost connection to MySQL server at ‘handshake: reading initial communication packet’, system error: 11

I was trying to fin the solution but without success. Is this image suitable to work on raspberry pi 4? And if yes please let me know what I am doing wrongly.

Best regards

Yep the container will work fine on a rpi4.

I suspect the issue is you’re using the incorrect volumes for our image. Please re-read our documentation for the container.

OK, I made an update

sudo docker run --volume /etc/mysql:/config --name mariadb-server -p 3307:3306 -e "MYSQL_ROOT_PASSWORD=password" -d linuxserver/mariadb

and the situation is the same, if I am removing volumes complete the situation is the same.

I checked logs, it is what I got:

Brought to you by linuxserver.io-

To support LSIO projects visit:
https:/www.linuxserver.io/donate/

GID/UID

User uid: 911
User gid: 911

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Your DockerHost is most likely running an outdated version of libseccomp

To fix this, please visit https:/docs.linuxserver.io/faq#libseccomp

Some apps might not behave correctly without this

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing…
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing…
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in ‘/config/databases’ …
426741-11-16 12:38:02 0 [ERROR] This MySQL server doesn’t support dates later than 2038

Installation of system tables failed! Examine the logs in
/config/databases for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /usr/bin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables;

Try ‘mysqld --help’ if you have problems with paths. Using
–general-log gives you a log in /config/databases that may be helpful.

The latest information about mysql_install_db is available at
https:/mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https:/downloads.mariadb.org and
the maria-discuss email list at https:/launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at https:mariadb.org/jira

According to recomendation from logs I did:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list
sudo apt update
sudo apt install -t buster-backports libseccomp2

and nothing happened the situation is still the same.In log is addtinlay an error:

426741-11-16 12:38:02 0 [ERROR] This MySQL server doesn’t support dates later than 2038

In recommended config/databases I have nothing inside

When I am installing mariadb as a stand alone program not within docker everything is running well. Please support me.

docker exec date returns 1970

Your logs tell you how to fix it

My post is long but please read it till the end

Right but your logs are telling you the issue to fix.

When I am updating libseccomp I am getting:

pi@raspberrypi:~ $ sudo apt install -t buster-backports libseccomp2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libseccomp2 is already the newest version (2.5.1-1~bpo10+1).
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.

So according to it, this issue was solved, or where I am making a mistake?

Also take note of the minimum version of Docker,

Perfect it is working thx, I installed docker.io package and it is out dated. Many thanks

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.