Hello @darh
I did not change anything in docker-compose.yaml, neither in .env
This is how the database is set up in docker-compose.yaml:
MYSQL_DATABASE: dbname
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbpass
get the random generated password by running: docker-compose logs db | grep âGENERATED ROOT PASSWORDâ
MYSQL_RANDOM_ROOT_PASSWORD: random
and in .env:
DB_DSN=dbuser:dbpass@tcp(db:3306)/dbname?collation=utf8mb4_general_ci
Also, I ran the startup in sequence and checked for the db to be up and running prior to the start of the server:
$ docker-compose up -d db
Creating corteza-prod_db_1 ⌠done
$ docker logs 65d4a819b7ba
2021-12-07T08:51:32.318146Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.26-16) starting as process 1
2021-12-07T08:51:32.326020Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-12-07T08:51:34.422911Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-12-07T08:51:35.207634Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-12-07T08:51:35.207739Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-12-07T08:51:35.208791Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-12-07T08:51:35.208933Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-12-07T08:51:35.296362Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: â::â port: 33060, socket: /var/lib/mysql/mysqlx.sock
2021-12-07T08:51:35.296597Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: â8.0.26-16â socket: â/var/lib/mysql/mysql.sockâ port: 3306 Percona Server (GPL), Release 16, Revision 3d64165.
uli@exeggutor:~/corteza-prod$ docker logs 65d4a819b7ba > db.log
2021-12-07T08:51:32.318146Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.26-16) starting as process 1
2021-12-07T08:51:32.326020Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-12-07T08:51:34.422911Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-12-07T08:51:35.207634Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-12-07T08:51:35.207739Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-12-07T08:51:35.208791Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-12-07T08:51:35.208933Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-12-07T08:51:35.296362Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: â::â port: 33060, socket: /var/lib/mysql/mysqlx.sock
2021-12-07T08:51:35.296597Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: â8.0.26-16â socket: â/var/lib/mysql/mysql.sockâ port: 3306 Percona Server (GPL), Release 16, Revision 3d64165.
$ docker-compose up -d server
corteza-prod_db_1 is up-to-date
Creating corteza-prod_server_1 ⌠done
$ docker logs 3480ab35a14c
{âlevelâ:âwarnâ,âtsâ:1638867218.5143187,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:1,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867228.5273678,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:2,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867238.5300703,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:3,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867248.5410929,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:4,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867258.544171,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:5,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867268.5554817,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:6,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867278.5664449,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:7,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867288.5781517,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:8,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867298.5896838,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:9,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867308.5972257,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:10,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867318.6053972,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:11,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867328.6167939,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:12,âdelayâ:10}
{âlevelâ:âwarnâ,âtsâ:1638867338.6207387,âloggerâ:âstore.rdbmsâ,âmsgâ:âcould not connect to the databaseâ,âerrorâ:âError 1045: Access denied for user âdbuserâ@â192.168.224.3â (using password: YES)â,âtryâ:13,âdelayâ:10}
$ docker-compose ps
Name Command State Ports
corteza-prod_db_1 /docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
corteza-prod_server_1 ./bin/corteza-server serve-api Up (unhealthy) 80/tcp
I wonder why the connection to the DB is denied.
When I exec into the db container and try connect it does not work either:
bash-4.4$ mysql -u dbuser -pdbpass
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user âdbuserâ@âlocalhostâ (using password: YES)
any ideas?
Thanks for your help. Uli