Error: permission denied while mysql_intstall_db - mariadb

I tried to install mariadb on blank Alpine Linux 3.6 in LXC container hosted on Turris OS (OpenWrt omnia 15.05 r47055).
Installation failed on permision denied error. I change privilegs but instalataror still failure.
root#alpinelxccontainer:~# DB_DATA_PATH="/var/lib/mysql"
root#alpinelxccontainer:~# DB_ROOT_PASS="heslo"
root#alpinelxccontainer:~# DB_USER="mariadb_user"
root#alpinelxccontainer:~# DB_PASS="heslo"
root#alpinelxccontainer:~# MAX_ALLOWED_PACKET="200M"
root#alpinelxccontainer:~# mysql_install_db --user=mysql --datadir=${DB_DATA_PATH}
WARNING: The host 'alpinelxccontainer' could not be looked up with /usr/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2018-07-25 22:14:30 3069281488 [Note] /usr/bin/mysqld (mysqld 10.1.32-MariaDB) starting as process 1876 ...
2018-07-25 22:14:30 3069281488 [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied")
2018-07-25 22:14:30 3069281488 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2018-07-25 22:14:30 3069281488 [ERROR] Plugin 'Aria' init function returned error.
2018-07-25 22:14:30 3069281488 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2018-07-25 22:14:30 3069281488 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
2018-07-25 22:14:30 3069281488 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-07-25 22:14:30 3069281488 [Note] InnoDB: The InnoDB memory heap is disabled
2018-07-25 22:14:30 3069281488 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-25 22:14:30 3069281488 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-07-25 22:14:30 3069281488 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-07-25 22:14:30 3069281488 [Note] InnoDB: Using Linux native AIO
2018-07-25 22:14:30 3069281488 [Note] InnoDB: Using generic crc32 instructions
2018-07-25 22:14:30 3069281488 [ERROR] mysqld: Can't create/write to file '/tmp/ibXXXXXX' (Errcode: 13 "Permission denied")
2018-07-25 22:14:30 b6f184d0 InnoDB: Error: unable to create temporary file; errno: 13
2018-07-25 22:14:30 3069281488 [ERROR] Plugin 'InnoDB' init function returned error.
2018-07-25 22:14:30 3069281488 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-07-25 22:14:30 3069281488 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-07-25 22:14:30 3069281488 [ERROR] Aborting
root#alpinelxccontainer:~# ls -la /var/lib/mysql/
total 0
drwxr-sr-x 1 mysql mysql 48 Jul 25 22:14 .
drwxr-xr-x 1 root root 36 Jul 25 22:09 ..
drwx------ 1 mysql mysql 0 Jul 25 22:14 mysql
-rw-rw---- 1 mysql mysql 0 Jul 25 22:14 mysql-bin.index
drwx------ 1 mysql mysql 0 Jul 25 22:14 test
root#alpinelxccontainer:~# chmod -R 777 /var/lib/mysql/
root#alpinelxccontainer:~# ls -la /var/lib/mysql/
total 0
drwxrwxrwx 1 mysql mysql 48 Jul 25 22:14 .
drwxr-xr-x 1 root root 36 Jul 25 22:09 ..
drwxrwxrwx 1 mysql mysql 0 Jul 25 22:14 mysql
-rwxrwxrwx 1 mysql mysql 0 Jul 25 22:14 mysql-bin.index
drwxrwxrwx 1 mysql mysql 0 Jul 25 22:14 test
root#alpinelxccontainer:~# mysql_install_db --user=mysql --datadir=${DB_DATA_PATH}
Still same error: [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied")
Complete dump of installation: https://gist.github.com/jakubs/24c642bc8d6779beaf1b944c6f399675
Related: installation guide: https://wiki.alpinelinux.org/wiki/MariaDB

Related

ERROR: InnoDB: Invalid flags 0x4800 in ./ibdata1 when installing MariaDB on macOS Ventura via Homebrew

I'm trying to install MariaDB (Ver 10.8.3-MariaDB for osx10.18 on arm64) via Homebrew (3.6.8) on macOS Ventura (13.0, Apple M1 Max) with the following steps:
brew install mariadb
Summary looks fine:
==> Summary
🍺 /opt/homebrew/Cellar/mariadb/10.8.3_1: 917 files, 174.8MB
But the following warning attracts my attention:
Warning: The post-install step did not complete successfully
You can try again using:
brew postinstall mariadb
Then when I run mysql I get the error:
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)
Running mysqld lists the following lines:
2022-11-03 16:01:12 0 [Note] mysqld (server 10.8.3-MariaDB) starting as process 94524 ...
2022-11-03 16:01:12 0 [Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
2022-11-03 16:01:12 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-03 16:01:12 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-03 16:01:12 0 [Note] InnoDB: Using generic crc32 instructions
2022-11-03 16:01:12 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-03 16:01:12 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-03 16:01:12 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2022-11-03 16:01:12 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2022-11-03 16:01:12 0 [Note] InnoDB: Starting shutdown...
2022-11-03 16:01:12 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-11-03 16:01:12 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-11-03 16:01:12 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-03 16:01:12 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2022-11-03 16:01:12 0 [ERROR] mysqld: unknown variable 'mysqlx-bind-address=127.0.0.1'
2022-11-03 16:01:12 0 [ERROR] Aborting
But unfortunately I have no clue how to solve the first listed error and I can't find any information about it:
2022-11-03 16:01:12 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
On advice I've deleted /opt/homebrew/var/mysql and reinstalled MariaDB, unfortunately with the same behavior afterwards. The new mysql direction contains:
this-mac.local.err
aria_log_control
ib_logfile0
aria_log.00000001
ib_buffer_pool
ibdata1
The […].local.err now contains:
221104 00:08:48 mysqld_safe Starting mariadbd daemon with databases from /opt/homebrew/var/mysql
2022-11-04 0:08:48 0 [Note] /opt/homebrew/opt/mariadb/bin/mariadbd (server 10.8.3-MariaDB) starting as process 12788 ...
2022-11-04 0:08:48 0 [Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
2022-11-04 0:08:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-04 0:08:48 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-04 0:08:48 0 [Note] InnoDB: Using generic crc32 instructions
2022-11-04 0:08:48 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-04 0:08:48 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-04 0:08:48 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-04 0:08:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-11-04 0:08:48 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-11-04 0:08:48 0 [Note] InnoDB: log sequence number 36426; transaction id 4
2022-11-04 0:08:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-04 0:08:48 0 [Note] InnoDB: Loading buffer pool(s) from /opt/homebrew/var/mysql/ib_buffer_pool
2022-11-04 0:08:48 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2022-11-04 0:08:48 0 [ERROR] /opt/homebrew/opt/mariadb/bin/mariadbd: unknown variable 'mysqlx-bind-address=127.0.0.1'
2022-11-04 0:08:48 0 [ERROR] Aborting
221104 00:08:48 mysqld_safe mysqld from pid file /opt/homebrew/var/mysql/MacBook-Pro-von-Malte.local.pid ended
I'm thankful for any hint and I'd like to give any additional information, if needed.
"Invalid flags 0x4800 in ./ibdata1" is an indication that the datadir was installed with MySQL-8.0.
MariaDB cannot start on a MySQL-8.0 datadir.
Also "mysqlx-bind-address=127.0.0.1" is a MySQL only system variable.
To install MariaDB you'll need to remove the MySQL datadir and configuration files first. (And backup any data there if its important).

How to solve an error regarding failed to initialise plugins in XAMPP?

I have the following message when I try to start my database in XAMP:
Error: MySQL shutdown unexpectedly. This may be due to a blocked port,
missing dependencies, improper privileges, a crash, or a shutdown by
another method. Press the Logs button to view error logs and check the
Windows Event Viewer for more clues. If you need more help, copy and
post this entire log window on the forums.
Here are my logs errors:
Cannot find checkpoint record at LSN (1,0x5946)
2022-08-31 17:08:07 0 [ERROR] mysqld.exe: Aria recovery failed. Please
run aria_chk -r on all Aria tables and delete all aria_log.########
files
2022-08-31 17:08:07 0 [ERROR] Plugin 'Aria' init function returned error.
2022-08-31 17:08:07 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2022-08-31 17:08:07 0 [Note] InnoDB: Mutexes and rw_locks use Windows
interlocked functions
2022-08-31 17:08:07 0 [Note] InnoDB: Uses event mutexes
2022-08-31 17:08:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-08-31 17:08:07 0 [Note] InnoDB: Number of pools: 1
2022-08-31 17:08:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-08-31 17:08:07 0 [Note] InnoDB: Initializing buffer pool, total
size = 16M, instances = 1, chunk size = 16M
2022-08-31 17:08:07 0 [Note] InnoDB: Completed initialization of
buffer pool
2022-08-31 17:08:07 0 [Note] InnoDB: 128 out of 128 rollback segments
are active.
2022-08-31 17:08:07 0 [Note] InnoDB: Creating shared tablespace for
temporary tables
2022-08-31 17:08:07 0 [Note] InnoDB: Setting file
'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the
file full; Please wait ...
2022-08-31 17:08:07 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1'
size is now 12 MB.
2022-08-31 17:08:07 0 [Note] InnoDB: Waiting for purge to start
2022-08-31 17:08:07 0 [Note] InnoDB: 10.4.24 started; log sequence
number 274011788; transaction id 115120
2022-08-31 17:08:07 0 [Note] InnoDB: Loading buffer pool(s) from
C:\xampp\mysql\data\ib_buffer_pool
2022-08-31 17:08:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-08-31 17:08:07 0 [Note] InnoDB: Buffer pool(s) load completed at
220831 17:08:07
2022-08-31 17:08:07 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2022-08-31 17:08:07 0 [ERROR] Failed to initialize plugins.
2022-08-31 17:08:07 0 [ERROR] Aborting
How could I fix this? Thank you in advance for any attempt to clarify this!
Stop the service. Delete from c:\xampp\mysql\data the files: "aria_log.00000001" and "aria_log_control" and start the service again. The files will be created again automatically and it will work.

MariaDB unable to start after update to version 10.6.5

i have just updated my maria db version to 10.6.5 and when i start apache is starts very well but when i start MySQL it doesn't rather..i have followed all the steps in updating the version but i cant really understand why its unable to start..here is the error log
2021-12-31 15:01:17 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-12-31 15:01:17 0 [Note] InnoDB: Number of pools: 1
2021-12-31 15:01:17 0 [Note] InnoDB: Using crc32 + pclmulqdq
instructions
2021-12-31 15:01:17 0 [Note] InnoDB: Initializing buffer pool, total
size = 16777216, chunk size = 16777216
2021-12-31 15:01:17 0 [Note] InnoDB: Completed initialization of
buffer pool
2021-12-31 15:01:18 0 [ERROR] InnoDB: Upgrade after a crash is not
supported. The redo log was created with MariaDB 10.4.16.
2021-12-31 15:01:18 0 [ERROR] InnoDB: Plugin initialization aborted
with error Generic error
2021-12-31 15:01:18 0 [Note] InnoDB: Starting shutdown...
2021-12-31 15:01:18 0 [ERROR] Plugin 'InnoDB' init function returned
error.
2021-12-31 15:01:18 0 [ERROR] Plugin 'InnoDB' registration as a
STORAGE ENGINE failed.
2021-12-31 15:01:18 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-12-31 15:01:18 0 [ERROR] Unknown/unsupported storage engine:
InnoDB
2021-12-31 15:01:18 0 [ERROR] Aborting

Permissions error in WordPress setup with Mariadb + NGINX and custom php-fpm Dockerfile

I'm trying to configure a WordPress installation based on docker-compose and with official docker images and a custom Dockerfile based image for the php-fpm part.
The docker-compose is like follows:
docker-compose.yml:
-------------------
# MariaDB - MySQL Database
mariadb:
container_name: mariadb
image: linuxserver/mariadb:latest
restart: always
security_opt:
- no-new-privileges:true
ports:
- "3306:3306"
secrets:
- mysql_root_password
volumes:
- /home/docker/mariadb/data:/config
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
healthcheck:
test: mysqladmin ping -h localhost -p$$MYSQL_ROOT_PASSWORD && test '0' -eq $$(ps aux | awk '{print $$11}' | grep -c -e '^mysql$$')
environment:
- PUID=1000
- PGID=998
- TZ=Europe/Madrid
- MYSQL_ALLOW_EMPTY_PASSWORD=no
- FILE__MYSQL_ROOT_PASSWORD=/run/secrets/mysql_root_password
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=wordpress
- MYSQL_DATABASE=wordpress
secrets:
- mysql_root_password
# Nginx - Web Server
nginx:
container_name: nginx
image: nginx:1.18
restart: unless-stopped
depends_on:
- php7
healthcheck:
test: pidof nginx
networks:
- t2_proxy
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /var/log/nginx:/var/log/nginx
- /home/docker/nginx:/etc/nginx
- /home/docker/shared/.htpasswd:/shared/.htpasswd
- /home/docker/sites/wordpress/html:/var/www/html/wordpress
labels:
- "traefik.enable=true"
## HTTP Routers (WordPress) Auth
- "traefik.http.routers.nginx-wordpress-auth-rtr.entrypoints=https"
- "traefik.http.routers.nginx-wordpress-auth-rtr.rule=Host(`example.com`) && Path(`/wp-login.php`)"
- "traefik.http.routers.nginx-wordpress-rtr.tls=true"
- "traefik.http.routers.nginx-wordpress-auth-rtr.priority=100"
## HTTP Routers (WordPress) Bypass
- "traefik.http.routers.nginx-wordpress-rtr.entrypoints=https"
- "traefik.http.routers.nginx-wordpress-rtr.rule=Host(`example.com`) || Host(`www.example.com`)"
- "traefik.http.routers.nginx-wordpress-rtr.priority=99"
# Redirect wordpress non-www to www middleware
- "traefik.http.middlewares.wordpress-redirect.redirectregex.regex=^https?://www.example.com/(.*)"
- "traefik.http.middlewares.wordpress-redirect.redirectregex.replacement=https://example.com/$${1}"
- "traefik.http.middlewares.wordpress-redirect.redirectregex.permanent=true"
## Middlewares
- "traefik.http.routers.nginx-wordpress-rtr.middlewares=wordpress-redirect,chain-no-auth-wp#file"
- "traefik.http.routers.nginx-wordpress-auth-rtr.middlewares=wordpress-redirect,chain-authelia#file"
# PHP - Hypertext Preprocessor
php7:
container_name: php7
image: php:7.4-fpm-custom
build:
context: /home/docker/custom/
dockerfile: Dockerfile-php7
restart: unless-stopped
healthcheck:
test: pidof php-fpm
user: 1000:998 # allows upgrading WP and plugins
networks:
- t2_proxy
volumes:
- /home/docker/sites/wordpress/html:/var/www/html/wordpress
- /home/docker/php/php7:/usr/local/etc/php
The Dockerfile used in the 'php7' container is based on official Wordpress php-fpm image:
Dockerfile-php7:
FROM php:7.4-fpm
# persistent dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
; \
rm -rf /var/lib/apt/lists/*
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libmagickwand-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
exif \
gd \
mysqli \
zip \
; \
# https://pecl.php.net/package/imagick
pecl install imagick-3.5.0; \
docker-php-ext-enable imagick; \
rm -r /tmp/pear; \
\
# https://pecl.php.net/package/redis
pecl install redis; \
docker-php-ext-enable redis; \
rm -r /tmp/pear; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN set -eux; \
docker-php-ext-enable opcache; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
RUN { \
# https://www.php.net/manual/en/errorfunc.constants.php
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \
echo 'log_errors = On'; \
echo 'error_log = /dev/stderr'; \
echo 'log_errors_max_len = 1024'; \
echo 'ignore_repeated_errors = On'; \
echo 'ignore_repeated_source = Off'; \
echo 'html_errors = Off'; \
} > /usr/local/etc/php/conf.d/error-logging.ini
I ensure that all Wordpress files are in the correct folder:
root#ubuntu:/home/docker# ls -l sites/wordpress/html/
total 220
-rw-r----- 1 1000 998 405 Feb 6 2020 index.php
-rw-r----- 1 1000 998 19915 Jan 1 2021 license.txt
-rw-r----- 1 1000 998 7346 Jul 6 12:23 readme.html
-rw-r----- 1 1000 998 7165 Jan 21 2021 wp-activate.php
drwxr-x--- 9 1000 998 4096 Sep 9 02:20 wp-admin
-rw-r----- 1 1000 998 351 Feb 6 2020 wp-blog-header.php
-rw-r----- 1 1000 998 2328 Feb 17 2021 wp-comments-post.php
-rw-r----- 1 1000 998 3004 May 21 10:40 wp-config-sample.php
-rw-r--r-- 1 1000 998 3153 Oct 5 05:47 wp-config.php
drwxr-x--- 4 1000 998 4096 Sep 9 02:20 wp-content
-rw-r----- 1 1000 998 3939 Jul 30 2020 wp-cron.php
drwxr-x--- 25 1000 998 16384 Sep 9 02:20 wp-includes
-rw-r----- 1 1000 998 2496 Feb 6 2020 wp-links-opml.php
-rw-r----- 1 1000 998 3900 May 15 17:38 wp-load.php
-rw-r----- 1 1000 998 45463 Apr 6 18:39 wp-login.php
-rw-r----- 1 1000 998 8509 Apr 14 2020 wp-mail.php
-rw-r----- 1 1000 998 22297 Jun 1 23:09 wp-settings.php
-rw-r----- 1 1000 998 31693 May 7 20:16 wp-signup.php
-rw-r----- 1 1000 998 4747 Oct 8 2020 wp-trackback.php
-rw-r----- 1 1000 998 3236 Jun 8 2020 xmlrpc.php
And the wp-config is pointing to the correct database:
wp-config.php
-------------
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** MySQL database username */
define( 'DB_USER', 'wordpress' );
/** MySQL database password */
define( 'DB_PASSWORD', 'wordpress' );
/** MySQL hostname */
define( 'DB_HOST', 'mariadb' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/** Filesystem access **/
define('FS_METHOD', 'direct');
With this setup, when I reach https://example.com I got a "File not found" error.
If I changed the ownership of the Wordpress files folder (/home/docker/sites/wordpress/html/) to 'docker' user I'm able to see the Wordpress app running, but and "Error establishing a database connection"
docker ps -a:
docker logs mariadb:
root#ubuntu-s-1vcpu-1gb-intel-ams3-01:/home/docker# docker logs mariadb
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[env-init] MYSQL_ROOT_PASSWORD set from FILE__MYSQL_ROOT_PASSWORD
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 1000
User gid: 998
-------------------------------------
[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' ...
2021-10-05 7:53:00 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at https://mariadb.com/kb or the
MySQL manual for more instructions.
You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
You can find additional information about the MySQL part at:
https://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2021-10-05 7:53:01 0 [Note] mysqld (mysqld 10.5.12-MariaDB-log) starting as process 306 ...
2021-10-05 7:53:02 0 [Note] InnoDB: Uses event mutexes
2021-10-05 7:53:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-05 7:53:02 0 [Note] InnoDB: Number of pools: 1
2021-10-05 7:53:02 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-10-05 7:53:02 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2021-10-05 7:53:02 0 [Note] InnoDB: Using Linux native AIO
2021-10-05 7:53:02 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2021-10-05 7:53:02 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-05 7:53:02 0 [Note] InnoDB: 128 rollback segments are active.
2021-10-05 7:53:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-10-05 7:53:02 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-10-05 7:53:02 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-10-05 7:53:02 0 [Note] InnoDB: 10.5.12 started; log sequence number 45094; transaction id 20
2021-10-05 7:53:02 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-10-05 7:53:02 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2021-10-05 7:53:02 0 [Note] InnoDB: Buffer pool(s) load completed at 211005 7:53:02
2021-10-05 7:53:02 0 [Note] Server socket created on IP: '::'.
2021-10-05 7:53:02 0 [Note] Reading of all Master_info entries succeeded
2021-10-05 7:53:02 0 [Note] Added new Master_info '' to hash table
2021-10-05 7:53:02 0 [Note] mysqld: ready for connections.
Version: '10.5.12-MariaDB-log' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
2021-10-05 7:53:03 0 [Note] mysqld (initiated by: root[root] # localhost []): Normal shutdown
2021-10-05 7:53:03 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-10-05 7:53:03 0 [Note] InnoDB: FTS optimize thread exiting.
2021-10-05 7:53:03 0 [Note] InnoDB: Starting shutdown...
2021-10-05 7:53:03 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
2021-10-05 7:53:03 0 [Note] InnoDB: Buffer pool(s) dump completed at 211005 7:53:03
2021-10-05 7:53:04 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-10-05 7:53:04 0 [Note] InnoDB: Shutdown completed; log sequence number 45106; transaction id 23
2021-10-05 7:53:04 0 [Note] mysqld: Shutdown complete
Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
211005 07:53:05 mysqld_safe Logging to '/config/databases/1e14f4ec3953.err'.
211005 07:53:05 mysqld_safe Starting mariadbd daemon with databases from /config/databases
docker logs php7:
[05-Oct-2021 05:52:57] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[05-Oct-2021 05:52:57] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'mcrypt' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mcrypt (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/mcrypt: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mcrypt.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/mcrypt.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[05-Oct-2021 05:52:57] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'pspell' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pspell (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/pspell: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pspell.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/pspell.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[05-Oct-2021 05:52:57] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'sockets' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/sockets (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/sockets: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/sockets.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/sockets.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[05-Oct-2021 05:52:57] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'ssh2' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ssh2 (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/ssh2: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ssh2.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/ssh2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: fpm is running, pid 1
[05-Oct-2021 05:52:58] NOTICE: ready to handle connections
192.168.90.10 - 05/Oct/2021:05:57:30 +0000 "GET /index.php" 404
192.168.90.10 - 05/Oct/2021:05:57:32 +0000 "GET /index.php" 404
192.168.90.10 - 05/Oct/2021:05:59:02 +0000 "GET /index.php" 404
192.168.90.10 - 05/Oct/2021:06:00:00 +0000 "GET /index.php" 404
192.168.90.10 - 05/Oct/2021:06:23:19 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:23:20 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:23:21 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:25:23 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:25:24 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:25:24 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:26:39 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:26:40 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:27:22 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:30 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:31 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:31 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:31 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:32 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:32 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:32 +0000 "GET /index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:41 +0000 "GET /wp-admin/index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:42 +0000 "GET /wp-admin/index.php" 500
192.168.90.10 - 05/Oct/2021:06:29:43 +0000 "GET /wp-admin/index.php" 500
192.168.90.10 - 05/Oct/2021:06:31:36 +0000 "GET /wp-admin/index.php" 500
I think my problem is something with the PUID/PGID and users, but I can't get it work. Hope someone could point me in the right direction.
Thank you all in advance!
It's because of the complicated and so strict that your file permission configured. I think that you are trying to config your php-fpm to use user 1000 and group 998. But it is a wrong way because php-fpm also need to access to /usr/local/lib/php/* to load php extensions. Php-fpm has it owned mechanism to to switch to another user to serve client request while using root (or other power user to load PHP/system configurations). Because you are not using root to start php-fpm so it does not have permission to switch to another user, so you see the logs:
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[05-Oct-2021 05:52:58] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
There are many ways to resolve your problems. If you still expect to use too strict the file permission like that, you will have to keep running php-fpm as root but on the php-fpm configuration (usually at etc/php-fpm.d/*.conf), you set user to 1000 and group to 998, so php-fpm will use that user and group to serve your client request and that user will be able to read your current source code files. However, I think you will have to make sure that user 1000 and 998 are existed in the image.
Secondly, I think your permission model is too strict and not necessary. I will grant +r for public to the source code files and start php-fpm as root (by default it will use www user to serve clients).

ERROR! MariaDB server PID file could not be found

After a hard restart on macOS (monitor blacked out) i can't get my mariadb to work.
ERROR! MariaDB server PID file could not be found! Starting MariaDB .210121 09:45:40 mysqld_safe Logging to '/usr/local/var/mysql/computer.local.err'
Logfile: /usr/local/var/mysql/computer.local.err
2021-01-21 9:48:16 0 [Note] InnoDB: Uses event mutexes
2021-01-21 9:48:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-21 9:48:16 0 [Note] InnoDB: Number of pools: 1
2021-01-21 9:48:16 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-01-21 9:48:16 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-01-21 9:48:16 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-21 9:48:16 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.11.
2021-01-21 9:48:16 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-01-21 9:48:16 0 [Note] InnoDB: Starting shutdown...
2021-01-21 9:48:16 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-01-21 9:48:16 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-01-21 9:48:16 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-21 9:48:16 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Mariadb is installed via homebrew
I have restarted and reinstalled mariadb via homebrew
any ideas how to fix this? :)
Solution
If found the solution, That is, to remove these /var/lib/mysql/ib_logfile*. Those logfiles prevented mariadb to start

Resources