mysql: Erro ao criar containers com usuario=root
Olá, Bruno!
Como vai?
Faltou informar a senha do usuário não root;
https://github.com/especializati/setup-docker-laravel/blob/main/docker-compose.yml#L38
mais não informei o usuario nao root e nem a senha, apenas usuario root e senha padrão
Só faltou a variável de ambiente MYSQL_USER:
MYSQL_USER:senha
Dessa forma se eu deixar da erro
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=curso_laravel_9
DB_USERNAME=root
DB_PASSWORD=root
A variável DB_USER é no arquivo docker-compose.yml, igual aqui:
https://github.com/especializati/setup-docker-laravel/blob/main/docker-compose.yml#L38
https://github.com/BrunoNeves1995/app-laravel.git
da uma olhada, se uso quaqluer usuario diferente de root da certo
O erro acontece quando? Qual vai subir o container do banco de dados?
isso mesmo, se deixo usuario = bruno ele sobi normalmente
Está certo, porque o usuário root é default, se tentar criar um novo usuário com o nome root vai dar erro mesmo. Se quiser usar o usuário root para se conectar ao banco, não informe a variável MYSQL_USER no docker-compose.yml
justamente, para mim ele não criava o usuario automatico, muito obrigado.
Boa noite. Tudo bem?
Segui conforme o github, mas não da certo. O container do mysql reinicia a todo instante. Consegue me ajudar por favor?
Omiti o MYSQL_USER
Meu .env esta assim:
E o log assim:
2024-11-22 00:38:03+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-11-22 00:38:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-11-22 00:38:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-11-22T00:38:05.991468Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-11-22T00:38:05.998771Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-11-22T00:38:06.004833Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2024-11-22T00:38:06.013894Z 0 [Warning] [MY-000054] [Server] World-writable config file '/var/lib/mysql/auto.cnf' is ignored.
2024-11-22T00:38:06.014944Z 0 [Warning] [MY-010107] [Server] World-writable config file '/var/lib/mysql/auto.cnf' has been removed.
2024-11-22T00:38:06.015488Z 0 [Warning] [MY-010075] [Server] 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: 0a09451a-a86a-11ef-8e89-0242ac1b0004.
2024-11-22T00:38:06.027421Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-11-22T00:38:07.780829Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2024-11-22T00:38:08.235587Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2024-11-22T00:38:08.235879Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.236100Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.236416Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.236748Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.237016Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.237251Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.237526Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-11-22T00:38:08.511175Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-11-22T00:38:08.725820Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-11-22T00:38:08.790072Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
2024-11-22T00:38:08.790135Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
mysqld: Cannot change permissions of the file 'private_key.pem.temp' (OS errno 1 - Operation not permitted)
2024-11-22T00:38:09.066855Z 0 [ERROR] [MY-010295] [Server] Could not set file permission for private_key.pem
2024-11-22T00:38:09.066897Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-11-22T00:38:10.282118Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40) MySQL Community Server - GPL.
Olá, Francisco! Tudo bem?
Cria uma nova thread (ticket), que te ajudo com o seu problema. Beleza?
Precisa estar logado para conseguir responder a este ticket!
Clique Aqui Para Entrar!