I installed php:8.0.9-apache under docker and checking logs after installation I see some
warnings in mysql part :
2021-10-15 14:48:59+03:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.35-1debian10 started.
2021-10-15 14:49:00+03:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-10-15 14:49:00+03:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.35-1debian10 started.
2021-10-15T11:49:00.429892Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-10-15T11:49:00.432747Z 0 [Note] mysqld (mysqld 5.7.35) starting as process 1 ...
2021-10-15T11:49:00.437047Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-10-15T11:49:00.437068Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-10-15T11:49:00.437072Z 0 [Note] InnoDB: Uses event mutexes
2021-10-15T11:49:00.437077Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-10-15T11:49:00.437081Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-15T11:49:00.437085Z 0 [Note] InnoDB: Using Linux native AIO
2021-10-15T11:49:00.437330Z 0 [Note] InnoDB: Number of pools: 1
2021-10-15T11:49:00.437445Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-10-15T11:49:00.439834Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-10-15T11:49:00.451513Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-15T11:49:00.454482Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-10-15T11:49:00.473993Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-10-15T11:49:00.511954Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-10-15T11:49:00.513212Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-10-15T11:49:00.679673Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-10-15T11:49:00.681160Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-10-15T11:49:00.681185Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-10-15T11:49:00.681582Z 0 [Note] InnoDB: Waiting for purge to start
2021-10-15T11:49:00.732209Z 0 [Note] InnoDB: 5.7.35 started; log sequence number 12659641
2021-10-15T11:49:00.734197Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-10-15T11:49:00.737074Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-10-15T11:49:00.744353Z 0 [Warning] World-writable config file './auto.cnf' is ignored.
2021-10-15T11:49:00.746941Z 0 [Warning] World-writable config file './auto.cnf' has been removed.
2021-10-15T11:49:00.747343Z 0 [Note] Salting uuid generator variables, current_pid: 1, server_start_time: 1634298540, bytes_sent: 0,
2021-10-15T11:49:00.747433Z 0 [Note] Generated uuid: 'e3496a7a-2dad-11ec-9925-0242ac160002', server_start_time: 281476611009197, bytes_sent: 94189482984608
2021-10-15T11:49:00.747464Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: e3496a7a-2dad-11ec-9925-0242ac160002.
2021-10-15T11:49:00.777304Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-10-15T11:49:00.777328Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-10-15T11:49:00.777334Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2021-10-15T11:49:00.777336Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2021-10-15T11:49:00.781639Z 0 [Warning] CA certificate ca.pem is self signed.
2021-10-15T11:49:00.781737Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-10-15T11:49:00.782643Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2021-10-15T11:49:00.782677Z 0 [Note] IPv6 is available.
2021-10-15T11:49:00.782690Z 0 [Note] - '::' resolves to '::';
2021-10-15T11:49:00.782702Z 0 [Note] Server socket created on IP: '::'.
2021-10-15T11:49:00.793751Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-10-15T11:49:00.800000Z 0 [Note] InnoDB: Buffer pool(s) load completed at 211015 14:49:00
2021-10-15T11:49:00.853789Z 0 [Note] Event Scheduler: Loaded 0 events
2021-10-15T11:49:00.854072Z 0 [Note] mysqld: ready for connections.
Version: '5.7.35' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
In docker-compose.yml I have :
mysql_db:
container_name: Hostels4J_db
image: mysql:5.7.35
restart: always
environment:
- MYSQL_DATABASE=dbname
- MYSQL_USER=user
- MYSQL_PASSWORD=321
- MYSQL_ALLOW_EMPTY_PASSWORD=false
- MYSQL_ROOT_PASSWORD=321
Testing how app works these warnings seems not critical, but I am not sure have I try to fix them
or I can I get rid of them? I would like to see my logs as clear as possible...
MODIFIED # 1 :
But where have I to change the file permissions ?
In the docker-compose.ymlfile I have :
mysql_db:
container_name: Hostels4J_db
image: mysql:5.7.35
# image: mysql:8.0.21
restart: always
environment:
- MYSQL_DATABASE=DockerHostels4J
- MYSQL_USER=docker_user
- MYSQL_PASSWORD=4321
- MYSQL_ALLOW_EMPTY_PASSWORD=false
- MYSQL_ROOT_PASSWORD=321
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
and in Dockerfile.yml :
RUN docker-php-ext-install pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite
These are all mysql options I have...
Thanks in advance!
Inside the mysql container image there seems to be a file auto.cnf that is world writable. Maybe the file permissions are set to 777? Reduce these permissions before running the container.
This is usually done at build-time using docker build ... and some Dockerfile.
MODIFIED 1:
In your dockerfile you will like to have something like
RUN chmod <less access privileges> <full path to auto.cnf>
To verify when running docker build, you could use
RUN ls -l <full path to auto.cnf>
Since your log output above only gives a relative path I cannot tell where exactly to find that file. But you could again use
RUN find / -name auto.cnf
There is one exception actually: if you happen to find the file inside the container in /var/lib/mysql, then actually it got mapped in there as external filesystem. In that case find the file in the hosts filesystem location, reduce the permissions and do not worry about the Dockerfile any more.
I'm trying to run 2 separate installations of Wordpress in Docker, but I'm having conflicts with the databases.
Here's what I've tried so far:
I runned the below code and got the logs also below.
Open putty > nano docker-compose.yml > pasted the below code > docker-compose up -d
version: '3.1'
services:
wordpress_multi_1:
image: wordpress
restart: always
ports:
- 11:80 ##change_this
environment:
WORDPRESS_DB_HOST: db_multi_1
WORDPRESS_DB_USER: exampleuser_multi_1
WORDPRESS_DB_PASSWORD: examplepass_multi_1
WORDPRESS_DB_NAME: exampledb_multi_1
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_1:/var/www/html ##change_this
db_multi_1:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb_multi_1
MYSQL_USER: exampleuser_multi_1
MYSQL_PASSWORD: examplepass_multi_1
MYSQL_RANDOM_ROOT_PASSWORD: '1' #I didn´t changed this
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_3/db1:/var/lib/mysql
# Other Instalation
wordpress_multi_2: #2nd_instance
image: wordpress
restart: always
ports:
- 12:80 ##change_this
environment:
WORDPRESS_DB_HOST: db_multi_2 #point to 2nd db instance
WORDPRESS_DB_USER: exampleuser_multi_2
WORDPRESS_DB_PASSWORD: examplepass_multi_2
WORDPRESS_DB_NAME: exampledb_multi_2
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2:/var/www/html ##change_this
db_multi_2: #2nd_instance
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb_multi_2
MYSQL_USER: exampleuser_multi_2
MYSQL_PASSWORD: examplepass_multi_2
MYSQL_RANDOM_ROOT_PASSWORD: '1' #I didn´t changed this
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2/db2:/var/lib/mysql
volumes: ##remove these line if you bind the volume to host machine
wordpress_multi_1:
db_multi_1:
wordpress_multi_2:
db_multi_2:
I can´t access the first container in MY-IP:11 ,
when I access 2nd container MY-IP:12 I get this error message Error establishing a database connection
I have this in the container logs:
In the Logs of root wordpress multi _1_1 I have this
[25-Jul-2020 15:53:03 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
MySQL Connection Error: (2002) Connection refused
WARNING: unable to establish a database connection to 'db_multi_1'
continuing anyways (which might have unexpected results)
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.27.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.27.0.3. Set the 'ServerName' directive globally to suppress this message
[Sat Jul 25 15:53:30.918212 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.8 configured -- resuming normal operations
[Sat Jul 25 15:53:30.918429 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
In the Logs of root_db_multi_1_1 I have this
2020-07-25 15:53:59+00:00 [Note] [Entrypoint]: Creating user exampleuser,
2020-07-25 15:53:59+00:00 [Note] [Entrypoint]: Giving user exampleuser access to schema exampledb,
,
2020-07-25 15:53:59+00:00 [Note] [Entrypoint]: Stopping temporary server,
2020-07-25T15:53:59.954860Z 0 [Note] Giving 0 client threads a chance to die gracefully,
2020-07-25T15:53:59.954994Z 0 [Note] Shutting down slave threads,
2020-07-25T15:53:59.955028Z 0 [Note] Forcefully disconnecting 0 remaining clients,
2020-07-25T15:53:59.955057Z 0 [Note] Event Scheduler: Purging the queue. 0 events,
2020-07-25T15:53:59.955668Z 0 [Note] Binlog end,
2020-07-25T15:53:59.957922Z 0 [Note] Shutting down plugin 'ngram',
2020-07-25T15:53:59.957982Z 0 [Note] Shutting down plugin 'partition',
2020-07-25T15:53:59.958006Z 0 [Note] Shutting down plugin 'BLACKHOLE',
2020-07-25T15:53:59.958027Z 0 [Note] Shutting down plugin 'ARCHIVE',
2020-07-25T15:53:59.958045Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA',
2020-07-25T15:53:59.958138Z 0 [Note] Shutting down plugin 'MRG_MYISAM',
2020-07-25T15:53:59.958162Z 0 [Note] Shutting down plugin 'MyISAM',
2020-07-25T15:53:59.958196Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL',
2020-07-25T15:53:59.958218Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES',
2020-07-25T15:53:59.958240Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES',
2020-07-25T15:53:59.958257Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS',
2020-07-25T15:53:59.958274Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN',
2020-07-25T15:53:59.958291Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS',
2020-07-25T15:53:59.958308Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS',
2020-07-25T15:53:59.958325Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES',
2020-07-25T15:53:59.958378Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS',
2020-07-25T15:53:59.958400Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES',
2020-07-25T15:53:59.958421Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE',
2020-07-25T15:53:59.958439Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE',
2020-07-25T15:53:59.958458Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG',
2020-07-25T15:53:59.958477Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED',
2020-07-25T15:53:59.958496Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED',
2020-07-25T15:53:59.958515Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD',
2020-07-25T15:53:59.958535Z 0 [Note] Shutting down plugin 'INNODB_METRICS',
2020-07-25T15:53:59.958555Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO',
2020-07-25T15:53:59.958575Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS',
2020-07-25T15:53:59.958595Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU',
2020-07-25T15:53:59.958614Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE',
2020-07-25T15:53:59.958633Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET',
2020-07-25T15:53:59.958652Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX',
2020-07-25T15:53:59.958672Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET',
2020-07-25T15:53:59.958696Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM',
2020-07-25T15:53:59.958715Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET',
2020-07-25T15:53:59.958732Z 0 [Note] Shutting down plugin 'INNODB_CMP',
2020-07-25T15:53:59.958755Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS',
2020-07-25T15:53:59.958773Z 0 [Note] Shutting down plugin 'INNODB_LOCKS',
2020-07-25T15:53:59.958792Z 0 [Note] Shutting down plugin 'INNODB_TRX',
2020-07-25T15:53:59.958813Z 0 [Note] Shutting down plugin 'InnoDB',
2020-07-25T15:53:59.959041Z 0 [Note] InnoDB: FTS optimize thread exiting.,
2020-07-25T15:53:59.959779Z 0 [Note] InnoDB: Starting shutdown...,
2020-07-25T15:54:00.060456Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool,
2020-07-25T15:54:00.062402Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 200725 15:54:00,
2020-07-25T15:54:02.601970Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12578970,
2020-07-25T15:54:02.606084Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1",
2020-07-25T15:54:02.606173Z 0 [Note] Shutting down plugin 'MEMORY',
2020-07-25T15:54:02.606192Z 0 [Note] Shutting down plugin 'CSV',
2020-07-25T15:54:02.606207Z 0 [Note] Shutting down plugin 'sha256_password',
2020-07-25T15:54:02.606218Z 0 [Note] Shutting down plugin 'mysql_native_password',
2020-07-25T15:54:02.606496Z 0 [Note] Shutting down plugin 'binlog',
2020-07-25T15:54:02.610743Z 0 [Note] mysqld: Shutdown complete,
,
2020-07-25 15:54:02+00:00 [Note] [Entrypoint]: Temporary server stopped,
,
2020-07-25 15:54:02+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.,
,
2020-07-25T15:54:03.386358Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).,
2020-07-25T15:54:03.392303Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...,
2020-07-25T15:54:03.404842Z 0 [Note] InnoDB: PUNCH HOLE support available,
2020-07-25T15:54:03.404912Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins,
2020-07-25T15:54:03.404931Z 0 [Note] InnoDB: Uses event mutexes,
2020-07-25T15:54:03.404949Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier,
2020-07-25T15:54:03.404967Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11,
2020-07-25T15:54:03.404984Z 0 [Note] InnoDB: Using Linux native AIO,
2020-07-25T15:54:03.405903Z 0 [Note] InnoDB: Number of pools: 1,
2020-07-25T15:54:03.406261Z 0 [Note] InnoDB: Using CPU crc32 instructions,
2020-07-25T15:54:03.412184Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M,
2020-07-25T15:54:03.450230Z 0 [Note] InnoDB: Completed initialization of buffer pool,
2020-07-25T15:54:03.458769Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().,
2020-07-25T15:54:03.477366Z 0 [Note] InnoDB: Highest supported file format is Barracuda.,
2020-07-25T15:54:03.572954Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables,
2020-07-25T15:54:03.573169Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...,
2020-07-25T15:54:04.136273Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.,
2020-07-25T15:54:04.140875Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.,
2020-07-25T15:54:04.140953Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.,
2020-07-25T15:54:04.142674Z 0 [Note] InnoDB: Waiting for purge to start,
2020-07-25T15:54:04.194101Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 12578970,
2020-07-25T15:54:04.196142Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool,
2020-07-25T15:54:04.198000Z 0 [Note] Plugin 'FEDERATED' is disabled.,
2020-07-25T15:54:04.214845Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200725 15:54:04,
2020-07-25T15:54:04.223928Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.,
2020-07-25T15:54:04.223996Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.,
2020-07-25T15:54:04.225843Z 0 [Warning] CA certificate ca.pem is self signed.,
2020-07-25T15:54:04.225943Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.,
2020-07-25T15:54:04.227467Z 0 [Note] Server hostname (bind-address): '*'; port: 3306,
2020-07-25T15:54:04.227657Z 0 [Note] IPv6 is available.,
2020-07-25T15:54:04.227691Z 0 [Note] - '::' resolves to '::';,
2020-07-25T15:54:04.227764Z 0 [Note] Server socket created on IP: '::'.,
2020-07-25T15:54:04.259808Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.,
2020-07-25T15:54:04.296032Z 0 [Note] Event Scheduler: Loaded 0 events,
2020-07-25T15:54:04.298053Z 0 [Note] mysqld: ready for connections.,
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL),
In the Logs of root wordpress multi_2_1 I have this:
[25-Jul-2020 15:53:03 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22,
,
MySQL Connection Error: (2002) Connection refused,
[25-Jul-2020 15:53:06 UTC] PHP Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES) in Standard input code on line 22,
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
MySQL Connection Error: (1045) Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
,
WARNING: unable to establish a database connection to 'db_multi_2',
continuing anyways (which might have unexpected results),
,
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.27.0.5. Set the 'ServerName' directive globally to suppress this message,
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.27.0.5. Set the 'ServerName' directive globally to suppress this message,
[Sat Jul 25 15:53:30.922486 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.8 configured -- resuming normal operations,
[Sat Jul 25 15:53:30.922705 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND',
192.168.1.21 - - [25/Jul/2020:15:53:48 +0000] "GET / HTTP/1.1" 500 2952 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
192.168.1.21 - - [25/Jul/2020:15:53:49 +0000] "GET /favicon.ico HTTP/1.1" 500 2952 "http://192.168.1.198:12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
192.168.1.21 - - [25/Jul/2020:16:01:07 +0000] "GET / HTTP/1.1" 500 2952 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
192.168.1.21 - - [25/Jul/2020:16:01:08 +0000] "GET /favicon.ico HTTP/1.1" 500 2952 "http://192.168.1.198:12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
In the Logs of root_db_multi_2_1 I have this
2020-07-25 15:53:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.,
2020-07-25 15:53:02+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',
2020-07-25 15:53:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.,
2020-07-25T15:53:03.349210Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).,
2020-07-25T15:53:03.355966Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...,
2020-07-25T15:53:03.369477Z 0 [Note] InnoDB: PUNCH HOLE support available,
2020-07-25T15:53:03.369554Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins,
2020-07-25T15:53:03.369574Z 0 [Note] InnoDB: Uses event mutexes,
2020-07-25T15:53:03.369600Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier,
2020-07-25T15:53:03.369618Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11,
2020-07-25T15:53:03.369636Z 0 [Note] InnoDB: Using Linux native AIO,
2020-07-25T15:53:03.370895Z 0 [Note] InnoDB: Number of pools: 1,
2020-07-25T15:53:03.371337Z 0 [Note] InnoDB: Using CPU crc32 instructions,
2020-07-25T15:53:03.379153Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M,
2020-07-25T15:53:03.423703Z 0 [Note] InnoDB: Completed initialization of buffer pool,
2020-07-25T15:53:03.432259Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().,
2020-07-25T15:53:03.449044Z 0 [Note] InnoDB: Highest supported file format is Barracuda.,
2020-07-25T15:53:03.749813Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12578846,
2020-07-25T15:53:03.750534Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12578855,
2020-07-25T15:53:03.750614Z 0 [Note] InnoDB: Database was not shutdown normally!,
2020-07-25T15:53:03.750659Z 0 [Note] InnoDB: Starting crash recovery.,
2020-07-25T15:53:03.952127Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1",
2020-07-25T15:53:03.952210Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables,
2020-07-25T15:53:03.952808Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...,
2020-07-25T15:53:05.161161Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.,
2020-07-25T15:53:05.168757Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.,
2020-07-25T15:53:05.168874Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.,
2020-07-25T15:53:05.172052Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 12578855,
2020-07-25T15:53:05.173264Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool,
2020-07-25T15:53:05.174026Z 0 [Note] Plugin 'FEDERATED' is disabled.,
2020-07-25T15:53:05.187982Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200725 15:53:05,
2020-07-25T15:53:05.195363Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.,
2020-07-25T15:53:05.195433Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.,
2020-07-25T15:53:05.197818Z 0 [Warning] CA certificate ca.pem is self signed.,
2020-07-25T15:53:05.197923Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.,
2020-07-25T15:53:05.199723Z 0 [Note] Server hostname (bind-address): '*'; port: 3306,
2020-07-25T15:53:05.199889Z 0 [Note] IPv6 is available.,
2020-07-25T15:53:05.199923Z 0 [Note] - '::' resolves to '::';,
2020-07-25T15:53:05.199996Z 0 [Note] Server socket created on IP: '::'.,
2020-07-25T15:53:05.232986Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.,
2020-07-25T15:53:05.269606Z 0 [Note] Event Scheduler: Loaded 0 events,
2020-07-25T15:53:05.271134Z 0 [Note] mysqld: ready for connections.,
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL),
2020-07-25T15:53:06.493594Z 2 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:09.499889Z 3 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:12.505293Z 4 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:15.510159Z 5 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:18.515748Z 6 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:21.522246Z 7 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:24.528657Z 8 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:27.534936Z 9 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:30.538996Z 10 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:49.230001Z 11 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T15:53:49.697588Z 12 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T16:01:07.993591Z 13 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
2020-07-25T16:01:08.232897Z 14 [Note] Access denied for user 'exampleuser'#'172.27.0.5' (using password: YES),
Can someone tell me what I am doing wrong? Or fix the code/stack I tried to run? I'm not an experienced user.
I had other installations of Wordpress in the past that I deleted and I am thinking that may be causing the conflicts... I don't know... I tried some diferences in the stack files that I searched the internet, renamed the containers, but I keep getting the same errors, and I am out of ideas.
Any solution will be appreciated. Thanks.
I'm running Open Media Vault > Docker > Portainer.
You are binding multiple volumes under same root of wordpress_multi_2.This is not a good way to mount volumes. Split them to separate folders (example for /wp and /db). And do not bind ports under 1024, as they are reserved, common convention for plaintext HTTP ports is like 8080 on development machines.
wordpress_multi_1:
...
ports:
- 8080:80
...
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_1/wp:/var/www/html
db_multi_1:
...
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_1/db:/var/lib/mysql
wordpress_multi_2: #2nd_instance
...
ports:
- 8081:80
...
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2/wp:/var/www/html
db_multi_2: #2nd_instance
...
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2/db:/var/lib/mysql
I finally got it to work!! And i even run a second Stack with a 3 and 4 installation just to check!
Following your advice, i changed the paths and the ports, and also added some things to the code, to be honest i´m not sure on what worked, but it´s working!
i added this:
links:
- db_multi_1
depends_on:
- db_multi_1
command: --default-authentication-plugin=mysql_native_password
One thing i noticed is that mysql container takes some minutes to fully start, only after that, the wordpress / MY-IP:8001 can work correctly.
Thanks for pointing me in the wright direction.
Full Stack:
version: '2.1'
services:
wordpress_multi_1:
image: wordpress
restart: always
ports:
- 8001:80 ##change_this to above 1024
links:
- db_multi_1
depends_on:
- db_multi_1
environment:
WORDPRESS_DB_HOST: db_multi_1
WORDPRESS_DB_USER: exampleuser_multi_1
WORDPRESS_DB_PASSWORD: examplepass_multi_1
WORDPRESS_DB_NAME: exampledb_multi_1
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_1/wp:/var/www/html ##change_this #Split them to separate folders (example for /wp and /db)
db_multi_1:
command: --default-authentication-plugin=mysql_native_password
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb_multi_1
MYSQL_USER: exampleuser_multi_1
MYSQL_PASSWORD: examplepass_multi_1
MYSQL_RANDOM_ROOT_PASSWORD: '1' #don´t change
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_1/db:/var/lib/mysql
# networks:
# local
# Other INstalation
wordpress_multi_2: #2nd_instance
image: wordpress
restart: always
ports:
- 8002:80 ##change_this
links:
- db_multi_2
depends_on:
- db_multi_2
environment:
WORDPRESS_DB_HOST: db_multi_2 #:3306 #point to 2nd db instance
WORDPRESS_DB_USER: exampleuser_multi_2
WORDPRESS_DB_PASSWORD: examplepass_multi_2
WORDPRESS_DB_NAME: exampledb_multi_2
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2/wp:/var/www/html ##change_this
db_multi_2: #2nd_instance
command: --default-authentication-plugin=mysql_native_password #resulta?
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb_multi_2
MYSQL_USER: exampleuser_multi_2
MYSQL_PASSWORD: examplepass_multi_2
MYSQL_RANDOM_ROOT_PASSWORD: '1' #don´t change
volumes:
- /srv/dev-disk-by-label-1TB/Config/wordpress_multi_2/db:/var/lib/mysql
# networks:
# local
volumes: ##remove these line if you bind the volume to host machine
wordpress_multi_1:
db_multi_1:
wordpress_multi_2:
db_multi_2:
I am new to Docker, I was trying to crate docker container of mariadb for my application but when I start running mariadb container it shows Access denied for user 'root'#'localhost' (using password: YES) dockerfile
Following is the docker compose I am using.
version: '3'
services:
mysql:
image: mariadb
container_name: mariadb
volumes:
- dbvolume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_ROOT_USER: root
MYSQL_USER: root
MYSQL_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
volumes:
dbvolume:
After trying for multiple times by referring few links I was able to connect my application to docker container but it failed to import AppDatabase.sql script at the time of creating docker container.
But now by using same docker compose file I am not able to connect mariadb to my application and I think even it's not importing SQL script to the database (based on logs I have observed).
Following is the docker log generated while running docker compose:
$ docker logs 3fde358ff015
2019-09-24 17:40:37 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 1 ...
2019-09-24 17:40:37 0 [Note] InnoDB: Using Linux native AIO
2019-09-24 17:40:37 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-24 17:40:37 0 [Note] InnoDB: Uses event mutexes
2019-09-24 17:40:37 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-24 17:40:37 0 [Note] InnoDB: Number of pools: 1
2019-09-24 17:40:37 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-09-24 17:40:37 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2019-09-24 17:40:37 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2019-09-24 17:40:37 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-24 17:40:37 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-09-24 17:40:37 0 [Note] InnoDB: Upgrading redo log: 2*50331648 bytes; LSN=21810033
2019-09-24 17:40:38 0 [Note] InnoDB: Starting to delete and rewrite log files.
2019-09-24 17:40:38 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2019-09-24 17:40:38 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2019-09-24 17:40:38 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-09-24 17:40:38 0 [Note] InnoDB: New log files created, LSN=21810033
2019-09-24 17:40:38 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-09-24 17:40:38 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-09-24 17:40:38 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-09-24 17:40:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-09-24 17:40:38 0 [Note] InnoDB: Waiting for purge to start
2019-09-24 17:40:38 0 [Note] InnoDB: 10.4.8 started; log sequence number 21810033; transaction id 14620
2019-09-24 17:40:38 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-09-24 17:40:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-09-24 17:40:38 0 [Note] Server socket created on IP: '::'.
2019-09-24 17:40:38 0 [Warning] 'proxies_priv' entry '#% root#c980daa43351' ignored in --skip-name-resolve mode.
2019-09-24 17:40:38 0 [Note] InnoDB: Buffer pool(s) load completed at 190924 17:40:38
2019-09-24 17:40:38 0 [Note] Reading of all Master_info entries succeeded
2019-09-24 17:40:38 0 [Note] Added new Master_info '' to hash table
2019-09-24 17:40:38 0 [Note] mysqld: ready for connections.
Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
SQL Script I am trying to import:
create database appdata;
use appdata;
CREATE TABLE `appdatadetails` (
`Name` varchar(8) NOT NULL,
`appIndex` int(11) NOT NULL,
`connector` varchar(16) DEFAULT NULL,
`intName` varchar(12) DEFAULT NULL,
`intIndex` int(11) DEFAULT NULL,
PRIMARY KEY (`Name`,`appIndex`)
)
Please help me to understand what I am doing wrong, I have tried all possible solution posted on different blogs.
Update:
Latest Update:
I was able to up and running mariadb docker image with 10.1. But if I attach volume then still I am facing issue.
Docker Compose:
version: '3'
services:
mysql:
image: mariadb:10.1
container_name: mariadb
volumes:
- container-volume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
volumes:
container-volume:
And the log error message, If I attach container-volume volume.
Creating mariadb ... done
Attaching to mariadb
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] mysqld (mysqld 10.1.41-MariaDB-1~bionic) starting as process 1 ...
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using Linux native AIO
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using SSE crc32 instructions
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Initializing buffer pool, size = 256.0M
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Completed initialization of buffer pool
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Highest supported file format is Barracuda.
mariadb | InnoDB: No valid checkpoint found.
mariadb | InnoDB: A downgrade from MariaDB 10.2.2 or later is not supported.
mariadb | InnoDB: If this error appears when you are creating an InnoDB database,
mariadb | InnoDB: the problem may be that during an earlier attempt you managed
mariadb | InnoDB: to create the InnoDB data files, but log file creation failed.
mariadb | InnoDB: If that is the case, please refer to
mariadb | InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] Plugin 'FEEDBACK' is disabled.
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Aborting
mariadb |
mariadb exited with code 1
If I remove container-volume then It is importing .sql script and running well and good.
Updated with working script: Before I was using mariadb 10.4.8 or latest and facing issue(s) to access DB and attaching external volume.
Now I have downgraded (As suggested by #Adiii) and tried. It runs perfectlly and we no need to specify external: true in volumes service
version: '3'
services:
mysql:
image: mariadb:10.1
container_name: mariadb
volumes:
- ./dbvolume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
It will affect the new user and keys even if you create fresh container.
Remove mount location, as it will pick a user name and password from this location, also will not run your DB init script too.
volumes:
- dbvolume:/var/lib/mysql
Also you do not need
create database appdata;
As database already created at
MYSQL_ROOT_PASSWORD: root123
MYSQL_ROOT_USER: root
MYSQL_DATABASE: appdata
this step.
update:
remove the user root, as root already defined. you can try with
version: '3.7'
services:
mysql:
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
image: mariadb
Or the second user should be different
version: '3.7'
services:
mysql:
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
MYSQL_USER: test
MYSQL_PASSWORD: root123
image: mariadb
you can try with
docker exec -it container_name bash -c "mysql -u test -proot123"
or
docker exec -it mysql bash -c "mysql -u root -proot123"
If still issue, remove the DB image, pull a new one.
Or try image tag 10.1
If I remove container-volume then It is importing .sql script and
running well and good.
if mount the location then the init script will not run as the container is expecting that there is already DB or try to remove named volume and create new one.
So mount the location, import the DB using MySQL command and use the mount location for next time.