This was my experience after emerging mariadb-10.5.9 and trying to start it up in an lxd container:
forums /etc/init.d # /etc/init.d/mysql start * Checking mysqld configuration for mysql ... 2021-10-02 22:07:32 0 [Warning] Could not increase number of max_open_files to more than 4096 (request: 32206) 2021-10-02 22:07:32 0 [Warning] Changed limits: max_open_files: 4096 max_connections: 151 (was 151) table_cache: 1957 (was 2000) 2021-10-02 22:07:32 0 [Warning] No argument was provided to --log-bin and neither --log-basename or --log-bin-index where used; This may cause repliction to break when this server acts as a master and has its hostname changed! Please use '--log-basename=forums' or '--log-bin=mariadb-bin' to avoid this problem. 2021-10-02 22:07:32 0 [ERROR] mysqld: File './mariadb-bin.index' not found (Errcode: 13 "Permission denied") * mysql config check failed [ !! ] * ERROR: mysql failed to start forums /etc/init.d # emerge --config mariadb Configuring pkg... * ERROR: dev-db/mariadb-10.5.9::core-server-kit failed (config phase): * mysql user cannot write into PID dir '/run/mysqld'! * * Call stack: * ebuild.sh, line 93: Called pkg_config * environment, line 4402: Called die * The specific snippet of code: * die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!"; * * If you need support, post the output of `emerge --info '=dev-db/mariadb-10.5.9::core-server-kit'`, * the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.5.9::core-server-kit'`. !!! When you file a bug report, please include the following information: GENTOO_VM= CLASSPATH="" JAVA_HOME="" JAVACFLAGS="" COMPILER="" and of course, the output of emerge --info =mariadb-10.5.9 * The complete build log is located at '/var/tmp/portage/dev-db/mariadb-10.5.9/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.5.9/temp/environment'. * Working directory: '/var/tmp/portage/dev-db/mariadb-10.5.9/homedir' * S: '/var/tmp/portage/dev-db/mariadb-10.5.9/work/mariadb-10.5.9'