I have the following docker-compose.yml file.
I would like to buildthem and connect to DB
version: '3'
services:
api-server:
build: ./api
links:
- 'db'
ports:
- '3000:3000'
volumes:
- ./api:/src
- ./src/node_modules
tty: true
container_name: api-server
db:
build:
context: .
dockerfile: ./db/Dockerfile
restart: always
hostname: db
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: root
MYSQL_PASSWORD: test
MYSQL_DATABASE: db
volumes:
- './db:/config'
ports:
- 3306:3306
container_name: db
After docker-compose build
then docker-compose up -d
And then `docker exec -it api-server sh'
I could enter containers. and tried
yarn ts-node node_modules/.bin/typeorm migration:show
typeorm command which connect to DB
But it returned
Error during migration show: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'#'172.18.0.3' (using password: YES)
Are there any way to fix it?
Where is the wrong point of it ?
Thanks
Here is docker logs db
docker logs db
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Initializing database files
2020-09-15T11:57:44.868762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:46.939481Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-09-15T11:57:47.252278Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2020-09-15T11:57:47.327831Z 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: abfbf3cb-f74a-11ea-bfe8-0242ac120002.
2020-09-15T11:57:47.331570Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2020-09-15T11:57:48.443477Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:48.733702Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Database files initialized
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Starting temporary server
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-09-15T11:57:52.490209Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:52.492212Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 77 ...
2020-09-15T11:57:52.497001Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:57:52.497114Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:57:52.497223Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:57:52.497332Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:57:52.497452Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:57:52.497542Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:57:52.498106Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:57:52.498434Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:57:52.501015Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:57:52.515593Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:57:52.518852Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:57:52.531163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:57:52.555422Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:57:52.555698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:57:52.665854Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:57:52.667159Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:57:52.667286Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:57:52.668320Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 2720554
2020-09-15T11:57:52.669761Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:57:52.669911Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:57:52.672485Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:57:52
2020-09-15T11:57:52.683725Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:57:52.683951Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:57:52.684864Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:52.684970Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:57:52.687815Z 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-09-15T11:57:52.704435Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:57:52.705512Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2020-09-15 11:57:53+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating database mogucare_db
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
2020-09-15 11:58:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15T11:58:03.406842Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:58:03.409690Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...
2020-09-15T11:58:03.418038Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:58:03.418101Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:58:03.418117Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:58:03.418133Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:58:03.418152Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:58:03.418170Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:58:03.419647Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:58:03.420784Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:58:03.425652Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:58:03.448462Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:58:03.457474Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:58:03.473399Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:58:03.477057Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2720554
2020-09-15T11:58:03.737975Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 7963136
2020-09-15T11:58:03.934900Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12578409
2020-09-15T11:58:03.936536Z 0 [Note] InnoDB: Database was not shutdown normally!
2020-09-15T11:58:03.936685Z 0 [Note] InnoDB: Starting crash recovery.
2020-09-15T11:58:04.147681Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
2020-09-15T11:58:05.179148Z 0 [Note] InnoDB: Apply batch completed
2020-09-15T11:58:05.286743Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-09-15T11:58:05.286809Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:58:05.286925Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:58:05.374586Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:58:05.376546Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:58:05.377004Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:58:05.378022Z 0 [Note] InnoDB: Waiting for purge to start
2020-09-15T11:58:05.439607Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 12578409
2020-09-15T11:58:05.442005Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:58:05.454028Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:58:05.492756Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:58:05
2020-09-15T11:58:05.518753Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:58:05.518785Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:58:05.519497Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:58:05.519541Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:58:05.536601Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-09-15T11:58:05.537666Z 0 [Note] IPv6 is available.
2020-09-15T11:58:05.537947Z 0 [Note] - '::' resolves to '::';
2020-09-15T11:58:05.538239Z 0 [Note] Server socket created on IP: '::'.
2020-09-15T11:58:05.552491Z 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-09-15T11:58:05.574297Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:58:05.574997Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2020-09-15T11:59:47.472547Z 3 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
2020-09-15T12:03:15.760923Z 4 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
The reason is in MySQL database mysql, table users. The user you are connecting with doesn't have permission - either because it doesn't exist, you have the wrong password, or you have no rights to connect from your IP to the target database.
In many cases, MySQL docker containers come configured to only allow connections to localhost (127.0.0.1) which means you must either (a) use port forwarding or (b) grant the user permission to connect from anywhere (i.e. %). Sometimes there is also a configuration switch that will automatically do this for you - read the documentation for your db container.
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:
below is a log of mysql
MYSQL shutdown frequent and i cant solve the problem
image file
logfile
2018-02-26T08:15:08.301271Z 591 [Warning] IP address '192.168.1.4' has been resolved to the host name '192.168.1.4', which resembles IPv4-address itself.
2018-02-26T08:15:08.395035Z 596 [Warning] IP address '192.168.1.4' has been resolved to the host name '192.168.1.4', which resembles IPv4-address itself.
2018-02-26T08:19:23.208784Z 0 [ERROR] InnoDB: Operating system error number 995 in a file operation.
2018-02-26T08:19:23.208784Z 0 [ERROR] InnoDB: The error means that the I/O operation has been aborted because of either a thread exit or an application request. Retry attempt is made.
2018-02-26 15:19:23 0x25b0 InnoDB: Assertion failure in thread 9648 in file fil0fil.cc line 5789
InnoDB: Failing assertion: err == DB_SUCCESS
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:19:23 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=8388608
read_buffer_size=65536
max_used_connections=48
max_threads=200
thread_count=7
connection_count=7
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 74620 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7f68cb05ea2 mysqld.exe!my_errno()
7f68cea9919 mysqld.exe!my_wildcmp_mb()
7f68cea8810 mysqld.exe!my_wildcmp_mb()
7f68cc05ac8 mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7f68cc2c49a mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7f68cbc4e94 mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7fefff81842 KERNEL32.DLL!BaseThreadInitThunk()
7ff012ac3f1 ntdll.dll!RtlUserThreadStart()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2018-02-26T08:19:36.819511Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.11-log) starting as process 7620 ...
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Uses event mutexes
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Number of pools: 1
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2018-02-26T08:19:36.897642Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-26T08:19:36.897642Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-26T08:19:36.944522Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 100862484017
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 100862486308
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 100862486308
2018-02-26T08:19:36.975774Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-02-26T08:19:36.975774Z 0 [Note] InnoDB: Starting crash recovery.
2018-02-26T08:19:37.444572Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
2018-02-26T08:19:37.975874Z 0 [Note] InnoDB: Apply batch completed
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-26T08:19:40.163591Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 100862486308
2018-02-26T08:19:40.163591Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\ProgramData\MySQL\MySQL Server 5.7\Data\ib_buffer_pool
2018-02-26T08:19:40.163591Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-26T08:19:40.491749Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-02-26T08:19:40.491749Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-26T08:19:40.491749Z 0 [Note] IPv6 is available.
2018-02-26T08:19:40.491749Z 0 [Note] - '::' resolves to '::';
2018-02-26T08:19:40.491749Z 0 [Note] Server socket created on IP: '::'.
2018-02-26T08:19:40.757400Z 0 [Note] Event Scheduler: Loaded 0 events
2018-02-26T08:19:40.757400Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: ready for connections.
Version: '5.7.11-log' socket: '' port: 3306 MySQL Community Server (GPL)
2018-02-26T08:19:45.164087Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180226 15:19:45
Suggestions for your my.cnf/ini [mysqld] section
Every x Connection listed in MySQLCalculator.com must be REMOVED from your my.cnf-ini to allow DEFAULTS to serve you.
thread_cache_size=100 # from 10 REFMAN v5.7 5.1.5 for CAP of 100 suggested
innodb_io_capacity=800 # from 200 to enable higher capacity
lock_wait_timeout=300 # from 31536000, who wants to wait ONE Year?
eq_range_index_dive_limit=20 $ from 200 not found in 20, is missing
expire_logs_days=5 # from 0 so you have limited historical logs
key_buffer_size=1M # from 8M you had key_blocks_used of 2
innodb_buffer_pool_instances=8 # from 1 to avoid mutex contention
innodb_buffer_pool_size=8G # from 128M until you need more for data volume
innodb_log_buffer_size=8M # from 134M - can not be > innodb_log_file_size
innodb_lru_scan_depth=128 # from 1024 see REFMAN for why
innodb_page_cleaners=64 # from 1 will be limited to be = innodb_buffer_pool_instances
innodb_print_all_deadlocks=ON # from OFF - check error log DAILY
innodb_read_io_threads=64 # from 4 see dba.stackexchange.com Q 5666 9/12/11
innodb_thread_concurrency=0 # in 5666 Rolando explains these 3 values
innodb_io_threads=64 # from 4 and how the combination enables multi-core
innodb_stats_sample_pages=32 # from 8 for more accurate cardinality
#max_allowed_packet=1G # leading # to disable for DEFAULT size
if you NEED larger size for LOCAL INFILE, in your SESSION,
SET #max_allowed_packet=nnnnnnnnnnnn up to 1G which is the MAX
max_seeks_for_key=32 # from a huge number, do not waste CPU past 32
max_write_lock_count=16 # from a huge number, allow RD after nn LOCKS
wait_timeout=3600 # from 8 hours, not touched in 1 HR release rscrs, log in again
Good luck.
Suggestions for your my.cnf/ini [mysqld] section
#sort_buffer_size=~256K # lead to allow DEFAULT to work for you
max_connections=100 # from 200 since max_used_connection were 48 since start
derived from your original posted information of 2/26/2018.
These changes will lower RAM requirements and we do not know how much RAM you have on your server.
I am having some trouble with my Digital Ocean's server which has a blog running on Wordpress.
Randomly the server goes on 100% memory/processing and over 200MB/s Disk IO until the blog crashes.
If I restart apache the server comes back to normal.
This is happening over three times a week and it has nothing to do with many users using the site at the same time.
I have browsed the internet and used some solutions and nothing has really helped.
I am using the following:
- Wordpress version: 4.7.2
- Php version:
PHP 5.6.28-1+deb.sury.org~xenial+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
- Linux Version:
Linux 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 16.04 server
I've spent some time looking on logfiles and the dmesg, fail2ban, faillog, and syslog does not have anything unusual.
However the apache error.log and access.log has some interesting things.
On the error log I've seen a lot of lines like these ones:
[Wed Oct 25 16:43:31.234364 2017] [:error] [pid 23211] [client 172.68.26.39:37081] PHP Warning: Error while sending QUERY packet. PID=23211 in public_html/wp-includes/wp-db.php on line 1877, referer: https://sitename/blogpostname/comment-page-6/
[Wed Oct 25 16:43:31.615950 2017] [:error] [pid 23216] [client 172.68.27.196:15015] PHP Warning: Error while sending QUERY packet. PID=23216 in public_html/wp-includes/wp-db.php on line 1877, referer: https://www.google.com.br/
[Wed Oct 25 16:43:31.600365 2017] [:error] [pid 23224] [client 172.68.27.64:20351] PHP Warning: Error while sending QUERY packet. PID=23224 in public_html/wp-includes/wp-db.php on line 1877, referer: https://www.google.com.br/
[Wed Oct 25 16:43:32.736840 2017] [:error] [pid 22410] [client 162.158.74.163:17321] PHP Warning: Error while sending QUERY packet. PID=22410 in public_html/wp-includes/wp-db.php on line 1877
Went on the wp-db.php file on line 1877 and it is a random usual line on the file, nothing wrong with it.
After a google search I've seen a lot of people with the same problem changing some variables on the php and apache configuration files.
So I've increased the following variables:
max_execution_time
max_allowed_packet_size
max_user_connections
max_connections
And disabled the W3 Total Cache plugin
Still with no Luck.
Checked the cronjobs and it doesn't have any job which trigger at the same time that I had this problem.
I am putting the apache's error.log and access.log and mysql error.log on the above links, in case you need them.
Last time I had this issue was 25 OCT 16:40h until the restart of the apache service at 16:57h
Some lines on the MYSQL ERROR LOG FILE
2017-10-25T18:40:00.355353Z 11952 [Note] Aborted connection 11952 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:40:01.869160Z 12116 [Note] Aborted connection 12116 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:10.465788Z 12185 [Note] Aborted connection 12185 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:11.058421Z 12199 [Note] Aborted connection 12199 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:13.415412Z 12187 [Note] Aborted connection 12187 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:15.844868Z 12186 [Note] Aborted connection 12186 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:21.387382Z 12217 [Note] Aborted connection 12217 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:21.418078Z 12218 [Note] Aborted connection 12218 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:21.747628Z 12093 [Note] Aborted connection 12093 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:24.705706Z 12219 [Note] Aborted connection 12219 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:43:29.267584Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-10-25T18:43:29.268753Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-10-25T18:43:29.812542Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-10-25T18:43:29.874865Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23296 ...
2017-10-25T18:43:29.945767Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-10-25T18:43:29.945855Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-10-25T18:43:29.945891Z 0 [Note] InnoDB: Uses event mutexes
2017-10-25T18:43:29.945902Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-10-25T18:43:29.945911Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-10-25T18:43:29.945922Z 0 [Note] InnoDB: Using Linux native AIO
2017-10-25T18:43:29.954531Z 0 [Note] InnoDB: Number of pools: 1
2017-10-25T18:43:29.957647Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-10-25T18:43:29.962895Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-10-25T18:43:30.069723Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-10-25T18:44:29.139834Z 0 [ERROR] InnoDB: Cannot allocate 1677722136 bytes of memory after 60 retries over 60 seconds. OS error: Cannot allocate memory (12). Check if you should increase the swap file or ulimits of your operating system. Note that on most 32-bit computers the process memory space is limited to 2 GB or 4 GB.
2017-10-25 16:44:29 0x7fec07b49740 InnoDB: Assertion failure in thread 140651718285120 in file ut0ut.cc line 931
InnoDB: Failing assertion: !m_fatal
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
18:44:29 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 76382 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xe7f80b]
/usr/sbin/mysqld(handle_fatal_signal+0x489)[0x784769]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fec06ac03d0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fec05e7a418]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fec05e7c01a]
/usr/sbin/mysqld[0x75a5ee]
/usr/sbin/mysqld(_ZN2ib14fatal_or_errorD2Ev+0x2e8)[0x1116f58]
/usr/sbin/mysqld[0xfd53c5]
/usr/sbin/mysqld(_Z8log_initv+0x4a5)[0xfdba25]
/usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x22ed)[0x10bcd3d]
/usr/sbin/mysqld[0xf81339]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7d1bc1]
/usr/sbin/mysqld[0xc665b5]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x608)[0xc6dc58]
/usr/sbin/mysqld[0x77cce4]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x7e4)[0x77e264]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fec05e65830]
/usr/sbin/mysqld(_start+0x29)[0x774c79]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2017-10-25T18:44:29.747705Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-10-25T18:44:29.747973Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-10-25T18:44:30.168154Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-10-25T18:44:30.175188Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23379 ...
2017-10-25T18:44:30.227947Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-10-25T18:44:30.228037Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-10-25T18:44:30.228056Z 0 [Note] InnoDB: Uses event mutexes
2017-10-25T18:44:30.228067Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-10-25T18:44:30.228075Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-10-25T18:44:30.228083Z 0 [Note] InnoDB: Using Linux native AIO
2017-10-25T18:44:30.229957Z 0 [Note] InnoDB: Number of pools: 1
2017-10-25T18:44:30.231671Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-10-25T18:44:30.235573Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-10-25T18:44:30.262313Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-10-25T18:45:26.314564Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-10-25T18:45:26.351139Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-10-25T18:45:26.387449Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 162362845023
2017-10-25T18:45:26.387528Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362845032
2017-10-25T18:45:26.387864Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362845032
2017-10-25T18:45:26.387888Z 0 [Note] InnoDB: Database was not shutdown normally!
2017-10-25T18:45:26.387932Z 0 [Note] InnoDB: Starting crash recovery.
2017-10-25T18:45:27.653149Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-10-25T18:45:27.655693Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-10-25T18:45:27.655993Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-10-25T18:45:27.832424Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-10-25T18:45:27.839253Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-10-25T18:45:27.839314Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-10-25T18:45:27.841792Z 0 [Note] InnoDB: Waiting for purge to start
2017-10-25T18:45:27.897127Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 162362845032
2017-10-25T18:45:27.913296Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-10-25T18:45:27.921641Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-10-25T18:45:28.017907Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-10-25T18:45:28.018041Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2017-10-25T18:45:28.018712Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2017-10-25T18:45:28.019306Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2017-10-25T18:45:28.163336Z 0 [Note] Event Scheduler: Loaded 0 events
2017-10-25T18:45:28.166514Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.15-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
2017-10-25T18:45:30.429764Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171025 16:45:30
2017-10-25T18:53:52.366879Z 159 [Note] Aborted connection 159 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:03.345944Z 200 [Note] Aborted connection 200 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:04.660063Z 199 [Note] Aborted connection 199 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:05.729653Z 177 [Note] Aborted connection 177 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:12.520890Z 205 [Note] Aborted connection 205 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:12.669290Z 155 [Note] Aborted connection 155 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:16.064185Z 175 [Note] Aborted connection 175 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:19.823038Z 51 [Note] Aborted connection 51 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:20.741167Z 206 [Note] Aborted connection 206 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:20.746381Z 42 [Note] Aborted connection 42 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:24.312023Z 122 [Note] Aborted connection 122 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:24.352842Z 186 [Note] Aborted connection 186 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:25.449125Z 148 [Note] Aborted connection 148 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
2017-10-25T18:56:28.626509Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-10-25T18:56:28.626841Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-10-25T18:56:30.071894Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-10-25T18:56:30.105638Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23873 ...
2017-10-25T18:56:30.235898Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-10-25T18:56:30.236056Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-10-25T18:56:30.236126Z 0 [Note] InnoDB: Uses event mutexes
2017-10-25T18:56:30.236150Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-10-25T18:56:30.236167Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-10-25T18:56:30.236182Z 0 [Note] InnoDB: Using Linux native AIO
2017-10-25T18:56:30.239770Z 0 [Note] InnoDB: Number of pools: 1
2017-10-25T18:56:30.243200Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-10-25T18:56:30.297785Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-10-25T18:56:30.471494Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-10-25T18:57:24.662239Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-10-25T18:57:24.855967Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-10-25T18:57:24.892537Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 162362990185
2017-10-25T18:57:24.892649Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362990194
2017-10-25T18:57:24.893393Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362990194
2017-10-25T18:57:24.893430Z 0 [Note] InnoDB: Database was not shutdown normally!
2017-10-25T18:57:24.893449Z 0 [Note] InnoDB: Starting crash recovery.
2017-10-25T18:57:25.486004Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-10-25T18:57:25.486109Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-10-25T18:57:25.486191Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-10-25T18:57:25.561775Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-10-25T18:57:25.565595Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-10-25T18:57:25.565662Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-10-25T18:57:25.583476Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 162362990194
2017-10-25T18:57:25.585667Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-10-25T18:57:25.589295Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-10-25T18:57:25.661688Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-10-25T18:57:25.661775Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2017-10-25T18:57:25.661845Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2017-10-25T18:57:25.661935Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2017-10-25T18:57:25.756913Z 0 [Note] Event Scheduler: Loaded 0 events
2017-10-25T18:57:25.758546Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.15-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
2017-10-25T18:57:25.958884Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171025 16:57:25
Some lines of the Apache Error.log
[Wed Oct 25 06:25:48.823233 2017] [core:notice] [pid 17104] AH00094: Command line: '/usr/sbin/apache2'
[Wed Oct 25 16:40:06.602720 2017] [:error] [pid 22585] [client 172.68.25.164:33251] PHP Warning: Error while sending QUERY packet. PID=22585 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877, referer: https://<site name>/2015/05/27/o-gerente-responde-qual-a-melhor-opcao-para-amortizar-o-financiamento-imobiliario/
[Wed Oct 25 16:40:35.820625 2017] [:error] [pid 22700] [client 162.158.74.163:29857] PHP Warning: Error while sending QUERY packet. PID=22700 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877, referer: https://<site name>/amortizacao-prazo-ou-parcela/
[Wed Oct 25 16:41:30.171910 2017] [:error] [pid 22751] [client 172.68.254.178:19539] PHP Warning: Error while sending QUERY packet. PID=22751 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877
[Wed Oct 25 16:44:52.784567 2017] [:error] [pid 22463] [client 108.162.219.224:10437] PHP Warning: Error while sending QUERY packet. PID=22463 in /var/www/mkt.<site name>/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1176
[Wed Oct 25 16:44:53.006562 2017] [:error] [pid 22892] [client 172.68.26.63:12817] PHP Warning: Error while sending QUERY packet. PID=22892 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877, referer: http://www.google.com.br/
[Wed Oct 25 16:44:56.689245 2017] [:error] [pid 22862] [client 108.162.219.224:9729] PHP Warning: Error while sending QUERY packet. PID=22862 in /var/www/mkt.<site name>/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1176
[Wed Oct 25 16:45:25.240149 2017] [:error] [pid 23208] [client 172.68.25.68:29319] PHP Warning: Error while sending QUERY packet. PID=23208 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877, referer: https://<site name>/2015/04/08/maquinas-de-cartao-de-credito-um-comparativo/
[Wed Oct 25 16:45:25.336803 2017] [:error] [pid 23228] [client 172.68.25.68:24895] PHP Warning: Error while sending QUERY packet. PID=23228 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877, referer: https://<site name>/2015/04/08/maquinas-de-cartao-de-credito-um-comparativo/
[Wed Oct 25 16:45:47.340049 2017] [:error] [pid 22925] [client 172.68.25.26:15907] PHP Warning: Error while sending QUERY packet. PID=22925 in /var/www/<site name>/public_html/wp-includes/wp-db.php on line 1877
AH00045: child process 22899 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:24.320984 2017] [core:warn] [pid 17104] AH00045: child process 22911 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:24.321014 2017] [core:warn] [pid 17104] AH00045: child process 22923 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:25.323354 2017] [core:warn] [pid 17104] AH00045: child process 23840 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:25.323570 2017] [core:warn] [pid 17104] AH00045: child process 23899 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:25.323586 2017] [core:warn] [pid 17104] AH00045: child process 22649 still did not exit, sending a SIGTERM
[Wed Oct 25 16:57:26.325315 2017] [core:notice] [pid 17104]
AH00051: child pid 23899 exit signal Segmentation fault (11), possible coredump in /etc/apache2`
[Wed Oct 25 16:57:29.895519 2017] [core:notice] [pid 24045] AH00094: Command line: '/usr/sbin/apache2'
[Wed Oct 25 16:57:27.326904 2017] [core:error] [pid 17104] AH00046: child process 23840 still did not exit, sending a SIGKILL
[Wed Oct 25 16:57:27.329833 2017] [core:error] [pid 17104] AH00046: child process 22649 still did not exit, sending a SIGKILL
[Wed Oct 25 16:57:28.340357 2017] [mpm_prefork:notice] [pid 17104] AH00169: caught SIGTERM, shutting down
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/newrelic.so' - /usr/lib/php/20131226/newrelic.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Oct 25 16:57:29.894473 2017] [mpm_prefork:notice] [pid 24045] AH00163: Apache/2.4.18 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.0.2g-fips configured -- resuming normal operations
My configuration files:
mysqld.cnf
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover-options = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
my.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
#innodb_log_file_size = 256M
[mysqld]
innodb_file_per_table
#innodb_file_format = Barracuda
max_allowed_packet = 1G
innodb_log_file_size = 500M
innodb_log_buffer_size = 800M
innodb_strict_mode = 0
wait_timeout = 100
php.ini
[PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 100
max_input_time = 60
memory_limit = -1
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 24M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
The GLOBAL STATUS and GLOBAL VARIABLES are on dropbox files:
https://www.dropbox.com/s/zzquqp4jfrs6z43/SHOW%20GLOBAL%20STATUS.txt?dl=0
https://www.dropbox.com/s/5p0hwlq2ma3c6jd/SHOW%20GLOBAL%20VARIABLES.txt?dl=0
And the Engine InnoDb status
Type Name Status
InnoDB "=====================================
2017-10-27 ..."
The following suggestions need your research before implementing ONLY one item per day. Some may be applied dynamically. Suggested cfg/ini values follow, could be modify, add or remove.
innodb_print_all_deadlocks=1 # from OFF to record in error log for CORRECTION
slow_query_log=1 # from OFF to record for possible CORRECTION
innodb_log_buffer_size=838860800 REMOVE to allow default of 16M (buffer size is larger than file size today and likely your most significant difficulty) NOT a dynamic variable
thread_cache_size=100 #from 8 to support 500 created threads since start
innodb_read_ahead_threshold=8 #from 56 for your intensity of reading
innodb_stats_sample_pages=32 #from 8 for more accurate cardinality of ndx's
have_query_cache=NO #from yes default since you have no intention of using qc
query_cache_size=0 #from 16M to conserve RAM
key_buffer_size=1M #from 16M, only used by ISAM. Low requirements
key_cache_age_threshold=64800 #from 300 seconds, avoid RD for 8 hours
max_write_lock_count=128 #from enormous number to allow RD after this nn
sql_select_limit=1000000000 #from enormous number to 1 Billion rows selected limit
table_open_cache= 10000 #from 2000 to support 40,000 opened since start.
ulimit needs to be reviewed and made more tolerant, if possible.
When appropriate, provide feedback, please.