Clearly there are some differences -- I used the most recent release, and am using amd64, and you're on an i386 architecture with OpenBSD-6.9.
6.9 is no longer supported, by the way. It was end-of-life with the release of 7.1 earlier this year.
Per step 4, I followed the provisioning guidance in the pkg-readme:
Code:
chrooted daemons and MariaDB socket
===================================
For external program running under a chroot(8) to be able to access the
MariaDB server without using a network connection, the socket must be
placed inside the chroot.
e.g. httpd(8) or nginx(8): connecting to MariaDB from PHP
---------------------------------------------------------
Create a directory for the MariaDB socket:
# install -d -m 0711 -o _mysql -g _mysql /var/www/var/run/mysql
Adjust /etc/my.cnf to use the socket in the chroot - this
applies to both client and server processes:
[client-server]
socket = /var/www/var/run/mysql/mysql.sock