【问题标题】:Laravel Sail Mysql 8.0 problem on existing project现有项目上的 Laravel Sail Mysql 8.0 问题
【发布时间】:2021-04-19 17:06:54
【问题描述】:

我已经创建了一个项目,我想开始使用 laravelsai 进行本地开发,但是当我使用 sail up --build 启动容器时,我在 mysql 容器中出现错误,并显示以下完整输出:

merkat-db       | 2021-01-14T16:34:34.729905Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * Running mode=standalone, port=6379.
redis_1         | 1:M 14 Jan 2021 16:34:34.340 # Server initialized
redis_1         | 1:M 14 Jan 2021 16:34:34.340 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * Loading RDB produced by version 6.0.10
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * RDB age 1236 seconds
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * RDB memory usage when created 0.77 Mb
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * DB loaded from disk: 0.000 seconds
redis_1         | 1:M 14 Jan 2021 16:34:34.340 * Ready to accept connections
merkat-db       | 2021-01-14T16:34:34.891168Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
merkat-app      | 2021-01-14 16:34:34,914 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
merkat-app      | 2021-01-14 16:34:34,914 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
merkat-app      | 2021-01-14 16:34:34,918 INFO RPC interface 'supervisor' initialized
merkat-app      | 2021-01-14 16:34:34,918 CRIT Server 'unix_http_server' running without any HTTP authentication checking
merkat-app      | 2021-01-14 16:34:34,919 INFO supervisord started with pid 16
merkat-db       | 2021-01-14T16:34:34.974741Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
merkat-db       | 2021-01-14T16:34:35.071102Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
merkat-db       | 2021-01-14T16:34:35.071429Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL_CTX_set_default_verify_paths failed
merkat-db       | 2021-01-14T16:34:35.072494Z 0 [ERROR] [MY-010285] [Server] Failure to parse RSA private key (file exists): /var/lib/mysql//private_key.pem: error:0909006C:PEM routines:get_name:no start line
merkat-db       | 2021-01-14T16:34:35.073336Z 0 [ERROR] [MY-010119] [Server] Aborting
merkat-app      | 2021-01-14 16:34:35,921 INFO spawned: 'php' with pid 18
merkat-app      | Starting Laravel development server: http://0.0.0.0:80
merkat-db       | 2021-01-14T16:34:36.494723Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22)  MySQL Community Server - GPL.
merkat-app      | [Thu Jan 14 16:34:36 2021] PHP 8.0.1 Development Server (http://0.0.0.0:80) started
merkat-db exited with code 1

错误就在这一行

merkat-db       | 2021-01-14T16:34:35.071429Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL_CTX_set_default_verify_paths failed
merkat-db       | 2021-01-14T16:34:35.072494Z 0 [ERROR] [MY-010285] [Server] Failure to parse RSA private key (file exists): /var/lib/mysql//private_key.pem: error:0909006C:PEM routines:get_name:no start line

我已经尝试解决这个问题的步骤:

  • 创建一个新的 private_key.pem

  • 更改mysql版本

  • 使用docker system prune -a从docker中删除所有图像

没有任何效果。

如果我创建一个新项目,我可以连接到 MySQL,但我不能在已经创建的项目上使用它

【问题讨论】:

  • 您的private_key.pem 是否以-----BEGIN RSA PRIVATE KEY----- 开头?
  • 你好,是的

标签: mysql laravel docker laravel-sail


【解决方案1】:

我通过执行以下命令解决了这个问题:

docker-compose down --volumes

然后:

sail up --build

我认为容器由于某种原因损坏了

【讨论】:

  • 这对我有用,我的问题是“root”用户和密码,请尝试使用上述命令更改它。它应该可以工作
  • @SampathGunasekara 就是这样,谢谢
猜你喜欢
  • 2023-01-10
  • 1970-01-01
  • 1970-01-01
  • 2021-03-24
  • 2021-09-01
  • 2021-04-19
  • 1970-01-01
  • 2021-10-16
  • 1970-01-01
相关资源
最近更新 更多