Open xbolshe opened 4 years ago
After manual command execution in mysql container (from https://github.com/scline/docker-cacti/blob/e347c2052517fcba388b580bce1ba5820ef38feb/start.sh#L74 to https://github.com/scline/docker-cacti/blob/e347c2052517fcba388b580bce1ba5820ef38feb/start.sh#L86), it works,
It seems that commands with ${INITIALIZE_DB} = 1 are not optimal in case of 2 separated containers.
Hrmm most of my installations are using multiple containers and I have not seen this. Looking at those logs it does not install the cacti
database because one already exists on with the same name on mysql.mysql.svc.cluster.local
. The INITIALIZE_DB
hook is for green-field databases only, so if an existing installation is present it will do odd things.
2020-08-16_21:09 [New Install] CREATE DATABASE cacti /*\!40100 DEFAULT CHARACTER SET utf8 */;
ERROR 1007 (HY000) at line 1: Can't create database 'cacti'; database exists
2020-08-16_21:09 [New Install] GRANT ALL ON cacti.* TO 'cacti' IDENTIFIED BY '*******';
ERROR 1044 (42000) at line 1: Access denied for user 'root'@'%' to database 'cacti'
Can you verify this is the case here? Running the commands manually is a bit odd, as they should error out with access denied unless the MySQL root password was different between runs.
If this is via docker-compose mind sharing so I can attempt to reproduce locally?
I use Kubernetes (not docker-compose). I have tried to delete all conatainers 3 times. And have the same issue. There is no problem, when mysql and cacti containers are in the same namespace of Kubernetes. But there is a problem, when namespaces are different.
But there is an access to MySQL from this container: