R
R
Ruslan Absalyamov2019-07-28 17:25:42
Docker
Ruslan Absalyamov, 2019-07-28 17:25:42

How to fix error with mysql when running docker?

I get a message when I run docker-compose uphow to fix this error?

mysql_kfnp | 2019-07-28T13:53:52.071302Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_kfnp | 2019-07-28T13:53:52.082482Z 0 [Note] mysqld (mysqld 5.7.27) starting as process 1 ...
mysql_kfnp | 2019-07-28T13:53:52.093849Z 0 [Note] InnoDB: PUNCH HOLE support available
mysql_kfnp | 2019-07-28T13:53:52.093913Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_kfnp | 2019-07-28T13:53:52.093920Z 0 [Note] InnoDB: Uses event mutexes
mysql_kfnp | 2019-07-28T13:53:52.093925Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mysql_kfnp | 2019-07-28T13:53:52.093930Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql_kfnp | 2019-07-28T13:53:52.093934Z 0 [Note] InnoDB: Using Linux native AIO
mysql_kfnp | 2019-07-28T13:53:52.094234Z 0 [Note] InnoDB: Number of pools: 1
mysql_kfnp | 2019-07-28T13:53:52.094812Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysql_kfnp | 2019-07-28T13:53:52.097054Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mysql_kfnp | 2019-07-28T13:53:52.107230Z 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_kfnp | 2019-07-28T13:53:52.109965Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_kfnp | 2019-07-28T13:53:52.153757Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800!
mysql_kfnp | 2019-07-28 13:53:52 0x7fa13ecf1740 InnoDB: Assertion failure in thread 140330520221504 in file ut0ut.cc line 910
mysql_kfnp | InnoDB: We intentionally generate a memory trap.
mysql_kfnp | InnoDB: Submit a detailed bug report to bugs.mysql.com.
mysql_kfnp | InnoDB: If you get repeated assertion failures or crashes, even
mysql_kfnp | InnoDB: immediately after the mysqld startup, there may be
mysql_kfnp | InnoDB: corruption in the InnoDB tablespace. Please refer to
mysql_kfnp | InnoDB: dev.mysql.com/doc/refman/5.7/en/forcing-innodb-rec...
mysql_kfnp | InnoDB: about forcing recovery.
mysql_kfnp | 13:53:52 UTC - mysqld got signal 6 ;
mysql_kfnp | This could be because you hit a bug. It is also possible that this binary
mysql_kfnp | or one of the libraries it was linked against is corrupt, improperly built,
mysql_kfnp | or misconfigured. This error can also be caused by malfunctioning hardware.
mysql_kfnp | Attempting to collect some information that could help diagnose the problem.
mysql_kfnp | As this is a crash and something is definitely wrong, the information
mysql_kfnp | collection process might fail.
mysql_kfnp |
mysql_kfnp | key_buffer_size=8388608
mysql_kfnp | read_buffer_size=131072
mysql_kfnp | max_used_connections=0
mysql_kfnp | max_threads=151
mysql_kfnp | thread_count=0
mysql_kfnp | connection_count=0
mysql_kfnp | It is possible that mysqld could use up to
mysql_kfnp | key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68196 K bytes of memory
mysql_kfnp | Hope that's ok; if not, decrease some variables in the equation.
mysql_kfnp |
mysql_kfnp | Thread pointer: 0x0
mysql_kfnp | Attempting backtrace. You can use the following information to find out
mysql_kfnp | where mysqld died. If you see no messages after this, something went
mysql_kfnp | terribly wrong...
mysql_kfnp | stack_bottom = 0 thread_stack 0x40000
mysql_kfnp | mysqld(my_print_stacktrace+0x2c)[0x55c70e621dcc]
mysql_kfnp | mysqld(handle_fatal_signal+0x479)[0x55c70df4c099]
mysql_kfnp | /lib/x86_64-linux-gnu/libpthread.so.0(+0x110e0)[0x7fa13e8ce0e0]
mysql_kfnp | /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf)[0x7fa13d05afff]
mysql_kfnp | /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fa13d05c42a]
mysql_kfnp | mysqld(+0x62a713)[0x55c70df22713]
mysql_kfnp | mysqld(_ZN2ib5fatalD1Ev+0x12d)[0x55c70e7f264d]
mysql_kfnp | mysqld(+0xfa73b1)[0x55c70e89f3b1]
mysql_kfnp | mysqld(+0xfa79e8)[0x55c70e89f9e8]
mysql_kfnp | mysqld(_Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_+0x2b0)[0x55c70e8a8ba0]
mysql_kfnp | mysqld(_Z13buf_read_pageRK9page_id_tRK11page_size_t+0xce)[0x55c70e85dc2e]
mysql_kfnp | mysqld(_Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb+0x4aa)[0x55c70e82ce6a]
mysql_kfnp | mysqld(_Z31trx_rseg_get_n_undo_tablespacesPm+0x143)[0x55c70e7d0ab3]
mysql_kfnp | mysqld(+0x629887)[0x55c70df21887]
mysql_kfnp | mysqld(_Z34innobase_start_or_create_for_mysqlv+0x2f3d)[0x55c70e79d94d]
mysql_kfnp | mysqld(+0xd70f08)[0x55c70e668f08]
mysql_kfnp | mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x4f)[0x55c70df96f6f]
mysql_kfnp | mysqld(+0xb16d66)[0x55c70e40ed66]
mysql_kfnp | mysqld(_Z40plugin_register_builtin_and_init_core_sePiPPc+0x2f0)[0x55c70e411f70]
mysql_kfnp | mysqld(+0x64c79e)[0x55c70df4479e]
mysql_kfnp | mysqld(_Z11mysqld_mainiPPc+0xc71)[0x55c70df46361]
mysql_kfnp | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7fa13d0482e1]
mysql_kfnp | mysqld(_start+0x2a)[0x55c70df3ca3a]
mysql_kfnp | The manual page at dev.mysql.com/doc/mysql/en/crashing.html contains
mysql_kfnp | information that should help you find out what is causing the crash.
mysql_kfnp exited with code 2

docker-composer.yml
version: '3'

services:
  webserver:
    container_name: apache-php_kfnp
    build:
      context: docker
      dockerfile: Dockerfile
    environment:
      XDEBUG_CONFIG: remote_host=host.docker.internal
      PHP_IDE_CONFIG: serverName=localhost
    ports:
    - 80:80
    volumes:
    - ./:/var/www
    links:
    - db
    depends_on:
    - db

  db:
    container_name: mysql_kfnp
    image: 'mysql:5.7'
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    ports:
    - 3336:3306
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: kfnp
      MYSQL_USER: kfnp-user
      MYSQL_PASSWORD: querty-123
    volumes:
    - docker/database:/var/lib/mysql

docker/dockerfile
#инструкция FROM - указывает на базе какого обараза будем собирать наш контейнер.
FROM ubuntu:latest

#инструкция RUN - указывает какую команду нужно выполнить внутри образа. обновим индекс пакетов
RUN apt-get update

RUN apt-get install -y apache2 apache2-utils curl gnupg wget
RUN a2enmod rewrite

#Инструкция ENV задает переменные окружения с именем <key> и значением <value>.
#Это значение будет находиться в окружении всех команд потомков Dockerfile и могут быть использованы как обычные переменные окружения.
ENV TZ=Europe/Moscow

#указываем временную зону для нашего образа.
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get install -y git python3 perl \
    php nano

#устанавливаем php расширения
RUN apt-get install -y \
    php-pdo php-pdo-mysql \
    php-mbstring php-tokenizer \
    php-xml php-simplexml php-zip \
    php-opcache php-iconv php-intl \
    php-json php-gd php-ctype php-oauth \
    php-apcu php-imagick php-xdebug \
    php-memcached php-ftp php-imap \
    php-curl iputils-ping

#после завершения установок всех пакетов - обновим индекс
RUN apt-get update

#откроем 80 порт
EXPOSE 80

#добавим в контейнер конфигурационный файл php.ini, расположим его на стаднатрном для ubuntu месте
ADD ./conf/php/php.ini /etc/php/7.2/apache2/php.ini

#обязательно добавим конфигурации xdebug
ADD ./conf/php/xdebug.ini /etc/php/7.2/mods-available/xdebug.ini

#добавим в контейнер конфигурационный файл для apache, расположим его на стаднатрном для ubuntu месте
ADD ./conf/apache/apache2.conf /etc/apache2/apache2.conf

#удалим содержащиеся файлы в этих папках, потому что вскоре там будут наши
RUN rm -R /etc/apache2/sites-enabled/* /etc/apache2/sites-available/* /var/www/*

#добавим конфигурацонный файл для виртуального сервера
ADD ./conf/apache/admin.kfnp.dev.conf /etc/apache2/sites-enabled/admin.kfnp.dev.conf
ADD ./conf/apache/free.kfnp.dev.conf /etc/apache2/sites-enabled/free.kfnp.dev.conf
ADD ./conf/apache/kfnp24.dev.conf /etc/apache2/sites-enabled/kfnp24.dev.conf
ADD ./conf/apache/kfnp.dev.conf /etc/apache2/sites-enabled/kfnp.dev.conf

#укажим дирректорию /var/www как рабочую
WORKDIR /var/www

#запускаем процес apache2 в нормальном режиме (На переднем плане).
#Пока живет это процесс, живет и контейнер.
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

Screen directory5d3db2f987efb134265673.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-07-28
@deepblack

Perhaps there is a solution
Windows appears there, but judging by the issue on GitHub, it also applies to Linux.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question