On 2025-10-01, Paul Pace <[email protected]> wrote: > Hello! > > I've recently upgraded a server with MariaDB to OpenBSD 7.7. After > following everything I wanted to be sure that upgrading to 11.4 didn't > result in somehow installing the defaults removed when I originally > installed (10.x) and ran mariadb-secure-installation. > > However, running mariadb-secure-installation prints the following error: > > ERROR 2002 (HY000): Can't connect to local server through socket > '/var/run/mysql/mysql.sock' (2) > > This makes sense as I have the following my.cnf: > > [client-server] > socket=/var/www/run/mysql/mysql.sock > #port=3306 > > It's possible this is not new behavior, but I wanted to see if this is > expected as I was thinking that it would use the configured socket > location.
mariadb-secure-installation uses its own temporary config file (to avoid feeding the password to the client binary via the command line). It uses some things from your /etc/my.cnf (via my_print_defaults) but doesn't pick up socket, which seems like a shortcoming upstream. All it does is remove the test db and anonymous users, makes sure that you have a password on the root user, etc, so you probably don't need to run it again (though I see why you might want to). FWIW I have this in rc.local (after setting the socket as above for www chroot), so I don't need to worry about whether a program parses my.cnf or not ... ln -s /var/www/var/run/mysql /var/run/ -- Please keep replies on the mailing list.

