Database issue: SQLSTATE[HY000] [2006] MySQL server has gone away
helllynx opened this issue · 1 comments
helllynx commented
Hi!
I've got this error:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away
and this in logs:
cloud-db | 2020-05-13 20:46:17 9 [Warning] Aborted connection 9 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.6' (This connection closed normally without authentication)
cloud-app | 172.19.0.4 - - [13/May/2020:20:46:17 +0000] "POST /index.php HTTP/1.1" 200 3606 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
cloud-app | [Wed May 13 20:46:29.151194 2020] [access_compat:error] [pid 33] [client 172.19.0.4:56694] AH01797: client denied by server configuration: /var/www/html/data/htaccesstest.txt
cloud-app | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "GET /data/htaccesstest.txt HTTP/1.1" 403 673 "-" "Nextcloud Server Crawler"
cloud-app | [Wed May 13 20:46:29.180728 2020] [access_compat:error] [pid 35] [client 172.19.0.4:56700] AH01797: client denied by server configuration: /var/www/html/data/htaccesstest.txt
cloud-app | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "GET /data/htaccesstest.txt HTTP/1.1" 403 673 "-" "Nextcloud Server Crawler"
cloud-db | 2020-05-13 20:46:29 10 [Warning] Aborted connection 10 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.6' (This connection closed normally without authentication)
cloud-app | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "POST /index.php HTTP/1.1" 200 3603 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
*.*.*.*
- my ip
when try to login first time.
I changed only paths in config, here it is:
# Containers name
DB_CONTAINER_NAME=cloud-db
DB_IMAGE_TAG=latest
APP_CONTAINER_NAME=cloud-app
APP_IMAGE_TAG=latest
# Mysql settings
MYSQL_HOST=cloud-db
MYSQL_DATABASE=cloud_db
MYSQL_ROOT_PASSWORD= cloud,root,password
MYSQL_USER=cloud_user
MYSQL_PASSWORD=cloud,user,password
# Nextcloud settings
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=admin,password
# Nextcloud data path
NEXTCLOUD_DATA_DIR=/var/www/html/data
NEXTCLOUD_TABLE_PREFIX=
# Nextcloud local data path
LOCAL_DB_DIR=/mnt/volume-cloud/cloud/data/db
LOCAL_DATA_DIR=/mnt/volume-cloud/cloud/data/cloud
LOCAL_CONF_DIR=/mnt/volume-cloud/cloud/data/cloud/config
LOCAL_APPS_DIR=/mnt/volume-cloud/cloud/data/cloud/apps
# Host
VIRTUAL_HOST=[here my domain]
LETSENCRYPT_HOST=[here my domain]
LETSENCRYPT_EMAIL=[here my mail]
#
# Network name
#
# Your container app must use a network conencted to your webproxy
# https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion
#
NETWORK=webproxy
Host is ubuntu-server 18.04.
Thank you!
helllynx commented
It's fixed just after i delete data folder /mnt/volume-cloud/cloud/data
and then run docker-compose up
Strange stuff)