Skip to content

Instantly share code, notes, and snippets.

@lox
Last active August 29, 2015 14:01
Show Gist options
  • Save lox/c9250b6e999a6cac96a5 to your computer and use it in GitHub Desktop.
Save lox/c9250b6e999a6cac96a5 to your computer and use it in GitHub Desktop.
#/bin/bash
set -e
if [ ! -f /var/lib/mysql/ibdata1 ]; then
chown -R mysql:mysql /var/lib/mysql
mysqld --verbose=0 --bootstrap <<EOF
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '' WITH GRANT OPTION;
EOF
fi
exec /usr/sbin/mysqld \
--bind-address=0.0.0.0 \
--log-error=/dev/stdout \
--log-warnings \
--slow-query-log \
--slow-query-log-file=/dev/stdout \
--general-log \
--general-log-file=/dev/stdout \
--max-connect-errors=4294967295
FROM ubuntu:14.04
# apt configuration
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/99dev
RUN apt-get update
RUN apt-get install mysql-server-5.6
# MySQL TCP port
EXPOSE 3306
ADD mysql-run.sh /
CMD ["/bin/bash", "/mysql-run.sh"]
2014-05-12 07:21:03 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-12 07:21:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-05-12 07:21:03 1 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-12 07:21:03 1 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2014-05-12 07:21:03 1 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2014-05-12 07:21:03 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-05-12 07:21:03 1 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-12 07:21:03 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-12 07:21:03 1 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-05-12 07:21:03 1 [Note] InnoDB: Using Linux native AIO
2014-05-12 07:21:03 1 [Note] InnoDB: Not using CPU crc32 instructions
2014-05-12 07:21:03 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-05-12 07:21:03 1 [Note] InnoDB: Completed initialization of buffer pool
2014-05-12 07:21:03 7effe504e780 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
2014-05-12 07:21:03 1 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions
2014-05-12 07:21:03 1 [ERROR] InnoDB: The system tablespace must be writable!
2014-05-12 07:21:03 1 [ERROR] Plugin 'InnoDB' init function returned error.
2014-05-12 07:21:03 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
/usr/sbin/mysqld: File '/dev/stdout' not found (Errcode: 13 - Permission denied)
2014-05-12 07:21:03 1 [ERROR] Could not use /dev/stdout for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
/usr/sbin/mysqld: File '/dev/stdout' not found (Errcode: 13 - Permission denied)
2014-05-12 07:21:03 1 [ERROR] Could not use /dev/stdout for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
2014-05-12 07:21:03 1 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-05-12 07:21:03 1 [ERROR] Aborting
@mastef
Copy link

mastef commented Jun 16, 2014

lox i had a similar issue on an outdated ubuntu:latest
seems the mysql directories were created with root:root as owners, but mysql tried to access them with the mysql user

starting without innodb enabled gave then the proper errors. latest ubuntu:latest seem to behave correctly with setting mysql:root as owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment