简体   繁体   English

使用带有虚拟框共享文件夹的docker机器启动mysql容器

[英]Starting mysql container using docker machine with virtual box shared folder

I'm trying to create a local dev setup using Docker Machine. 我正在尝试使用Docker Machine创建本地开发人员设置。 I keep running into error when trying to create a mysql container. 尝试创建mysql容器时,我一直遇到错误。 Here's my setup. 这是我的设置。

docker-machine version 0.3.0 docker-机器版本0.3.0

Virtualbox version 4.3.30 Virtualbox版本4.3.30

Default boot2docker vm in virtualbox, with shared folder /Users virtualbox中的默认boot2docker vm,具有共享文件夹/ Users

I created the mysql folder to be mounted on creating the container at /Users/tinnguyen/Development/Docker/containers/mysql 我创建了要安装在/Users/tinnguyen/Development/Docker/containers/mysql上的容器的mysql文件夹

Standard permission: 标准权限:

drwxr-xr-x 2 tinnguyen staff 68 Jul 25 16:45 mysql

Below is my docker command 以下是我的docker命令

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=root -v /Users/tinnguyen/Development/Docker/containers/mysql:/var/lib/mysql mysql

When I do docker logs mysql , this is the error I got 当我执行docker logs mysql ,这是我得到的错误

docker logs mysql
Running mysql_install_db
2015-07-25 21:45:45 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 29 ...
2015-07-25 21:45:45 29 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-25 21:45:45 29 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-25 21:45:45 29 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-25 21:45:45 29 [Note] InnoDB: Memory barrier is not used
2015-07-25 21:45:45 29 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-07-25 21:45:45 29 [Note] InnoDB: Using Linux native AIO
2015-07-25 21:45:45 29 [Note] InnoDB: Not using CPU crc32 instructions
2015-07-25 21:45:45 29 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-25 21:45:45 29 [Note] InnoDB: Completed initialization of buffer pool
2015-07-25 21:45:45 7f8c9b939720  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.
2015-07-25 21:45:45 7f8c9b939720  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.
2015-07-25 21:45:45 29 [ERROR] InnoDB: Creating or opening ./ibdata1 failed!
2015-07-25 21:45:45 29 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-07-25 21:45:45 29 [ERROR] Plugin 'InnoDB' init function returned error.
2015-07-25 21:45:45 29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-07-25 21:45:45 29 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-07-25 21:45:45 29 [ERROR] Aborting

2015-07-25 21:45:45 29 [Note] Binlog end
2015-07-25 21:45:45 29 [Note] /usr/sbin/mysqld: Shutdown complete

Would really appreciate any help! 非常感谢您的帮助! Thanks. 谢谢。

By default, it should be setup correctly and work but you may want to check the folder sharing setting on VirtualBox. 默认情况下,它应该正确设置并可以使用,但是您可能需要检查VirtualBox上的文件夹共享设置。

run VirtualBox, check the default machine Settings. 运行VirtualBox,检查默认机器设置。 Click on Shared Folders and verify that /Users folder from your host macbook is mounted in the VM. 单击“共享文件夹”,然后验证主机Macbook中的/ Users文件夹是否已安装在VM中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM