jjzjj

mysql - Windows 上的 "docker-compose up "因 Mysql 容器步骤错误而失败

coder 2024-06-16 原文

我正在尝试使用 docker 和 docker-compose.yml 在 phpstorm 中为 Windows 10 上的 php 开发设置我的环境,但在 Mysql 设置步骤中出现了一些错误。找不到问题。

这是我的 docker-compose.yml:

version:  '2'

volumes:
  database_data:
    driver: local

services:
  nginx:
    image: nginx:latest
    ports:
      - 8080:80
    volumes:
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    volumes_from:
      - php

  php:
    build: ./docker/php/
    expose:
      - 9000
    volumes:
      - .:/var/www/html

  mysql:
    image: mysql:latest
    ports:
      - 3306:3306
    expose:
      - 3306
    environment:
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_DATABASE: fs_db
      MYSQL_USER: fs_user
      MYSQL_PASSWORD: pass
    volumes:
        - database_data:/var/lib/mysql

然后我在控制台中尝试:

docker-compose up

但是在 mysql 容器设置步骤中得到了这个:

mysql_1  | 2018-01-10T18:47:16.115382Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1  | 2018-01-10T18:47:16.116034Z 0 [Note] mysqld (mysqld 5.7.20) starting as process 1 ...
mysql_1  | 2018-01-10T18:47:16.117730Z 0 [Note] InnoDB: PUNCH HOLE support available
mysql_1  | 2018-01-10T18:47:16.117747Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1  | 2018-01-10T18:47:16.117750Z 0 [Note] InnoDB: Uses event mutexes
mysql_1  | 2018-01-10T18:47:16.117751Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mysql_1  | 2018-01-10T18:47:16.117753Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
mysql_1  | 2018-01-10T18:47:16.117758Z 0 [Note] InnoDB: Using Linux native AIO
mysql_1  | 2018-01-10T18:47:16.117964Z 0 [Note] InnoDB: Number of pools: 1
mysql_1  | 2018-01-10T18:47:16.118084Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysql_1  | 2018-01-10T18:47:16.118933Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mysql_1  | 2018-01-10T18:47:16.122885Z 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_1  | 2018-01-10T18:47:16.123824Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_1  | 2018-01-10T18:47:16.134547Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4000!
mysql_1  | 2018-01-10 18:47:16 0x7f6fcbe6d740  InnoDB: Assertion failure in thread 140118139000640 in file ut0ut.cc line 916
mysql_1  | InnoDB: We intentionally generate a memory trap.
mysql_1  | InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
mysql_1  | InnoDB: If you get repeated assertion failures or crashes, even
mysql_1  | InnoDB: immediately after the mysqld startup, there may be
mysql_1  | InnoDB: corruption in the InnoDB tablespace. Please refer to
mysql_1  | InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
mysql_1  | InnoDB: about forcing recovery.
mysql_1  | 18:47:16 UTC - mysqld got signal 6 ;
mysql_1  | This could be because you hit a bug. It is also possible that this binary
mysql_1  | or one of the libraries it was linked against is corrupt, improperly built,
mysql_1  | or misconfigured. This error can also be caused by malfunctioning hardware.
mysql_1  | Attempting to collect some information that could help diagnose the problem.
mysql_1  | As this is a crash and something is definitely wrong, the information
mysql_1  | collection process might fail.
mysql_1  |
mysql_1  | key_buffer_size=8388608
mysql_1  | read_buffer_size=131072
mysql_1  | max_used_connections=0
mysql_1  | max_threads=151
mysql_1  | thread_count=0
mysql_1  | connection_count=0
mysql_1  | It is possible that mysqld could use up to
mysql_1  | key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68193 K  bytes of memory
mysql_1  | Hope that's ok; if not, decrease some variables in the equation.
mysql_1  |
mysql_1  | Thread pointer: 0x0
mysql_1  | Attempting backtrace. You can use the following information to find out
mysql_1  | where mysqld died. If you see no messages after this, something went
mysql_1  | terribly wrong...
mysql_1  | stack_bottom = 0 thread_stack 0x40000
mysql_1  | mysqld(my_print_stacktrace+0x2c)[0xe889ac]
mysql_1  | mysqld(handle_fatal_signal+0x459)[0x7aba79]
mysql_1  | /lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7f6fcba4a890]
mysql_1  | /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f6fca453067]
mysql_1  | /lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f6fca454448]
mysql_1  | mysqld[0x781ae3]
mysql_1  | mysqld(_ZN2ib5fatalD1Ev+0x15d)[0x1113dbd]
mysql_1  | mysqld[0x11c5afc]
mysql_1  | mysqld[0x11c5fdc]
mysql_1  | mysqld(_Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_+0x1e0)[0x11d1380]
mysql_1  | mysqld(_Z13buf_read_pageRK9page_id_tRK11page_size_t+0xcf)[0x118224f]
mysql_1  | mysqld(_Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb+0x389)[0x11529b9]
mysql_1  | mysqld(_Z31trx_rseg_get_n_undo_tablespacesPm+0x143)[0x10f2b63]
mysql_1  | mysqld[0x780ded]
mysql_1  | mysqld(_Z34innobase_start_or_create_for_mysqlv+0x357d)[0x10c07bd]
mysql_1  | mysqld[0xf86e28]
mysql_1  | mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7f7001]
mysql_1  | mysqld[0xc7bb66]
mysql_1  | mysqld(_Z11plugin_initPiPPci+0x5b8)[0xc82bf8]
mysql_1  | mysqld[0x7a42be]
mysql_1  | mysqld(_Z11mysqld_mainiPPc+0x7e9)[0x7a58d9]
mysql_1  | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f6fca43fb45]
mysql_1  | mysqld[0x79c384]
mysql_1  | The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
mysql_1  | information that should help you find out what is causing the crash.
fightstarter_mysql_1 exited with code 2

试图在 github 上找到问题,但我找不到任何类似的问题。

最佳答案

谢谢你!您的回答加上一些调整,它起作用了:

  1. docker-compose down
  2. docker system prune --force --volumes
  3. 在 docker-compose.yml 的 mysql 部分添加了命令:--disable-partition-engine-check
  4. 使用 docker-compose up -d 运行它以在后台设置它。

关于mysql - Windows 上的 "docker-compose up "因 Mysql 容器步骤错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48194404/

有关mysql - Windows 上的 "docker-compose up "因 Mysql 容器步骤错误而失败的更多相关文章

  1. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  2. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  3. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  4. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  5. ruby-on-rails - date_field_tag,如何设置默认日期? [ rails 上的 ruby ] - 2

    我想设置一个默认日期,例如实际日期,我该如何设置?还有如何在组合框中设置默认值顺便问一下,date_field_tag和date_field之间有什么区别? 最佳答案 试试这个:将默认日期作为第二个参数传递。youcorrectlysetthedefaultvalueofcomboboxasshowninyourquestion. 关于ruby-on-rails-date_field_tag,如何设置默认日期?[rails上的ruby],我们在StackOverflow上找到一个类似的问

  6. ruby-on-rails - openshift 上的 rails 控制台 - 2

    我将我的Rails应用程序部署到OpenShift,它运行良好,但我无法在生产服务器上运行“Rails控制台”。它给了我这个错误。我该如何解决这个问题?我尝试更新ruby​​gems,但它也给出了权限被拒绝的错误,我也无法做到。railsc错误:Warning:You'reusingRubygems1.8.24withSpring.UpgradetoatleastRubygems2.1.0andrun`gempristine--all`forbetterstartupperformance./opt/rh/ruby193/root/usr/share/rubygems/rubygems

  7. ruby-on-rails - 迷你测试错误 : "NameError: uninitialized constant" - 2

    我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test

  8. ruby-on-rails - 相关表上的范围为 "WHERE ... LIKE" - 2

    我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que

  9. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  10. ruby - 安装 Ruby 时遇到问题(无法下载资源 "readline--patch") - 2

    当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub

随机推荐