无法启动服务器:绑定在unix socket上:不允许操作
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法启动服务器:绑定在unix socket上:不允许操作相关的知识,希望对你有一定的参考价值。
环境:docker:Docker版本17.12.0-ce,构建c97c6d6 windows:windows 10 docker-images:mysql / mysql-server latest
我使用此命令成功创建一个容器,但几秒后自动停止:
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD="root" -e MYSQL_USER="sa" -e MYSQL_PASSWORD="123456" -v "/C/mysql/Config/my.cnf":/etc/my.cnf -v "/C/mysql/Data":/var/lib/mysql --name server mysql/mysql-server
docker日志服务器:
Starting MySQL 5.7.21-1.1.3
2018-02-11T12:53:22.120561Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-11T12:53:22.125276Z 0 [Note] mysqld (mysqld 5.7.21) starting as process 1 ...
2018-02-11T12:53:22.139968Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-11T12:53:22.140147Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-11T12:53:22.140221Z 0 [Note] InnoDB: Uses event mutexes
2018-02-11T12:53:22.140282Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-02-11T12:53:22.140345Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-11T12:53:22.140404Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-11T12:53:22.141479Z 0 [Note] InnoDB: Number of pools: 1
2018-02-11T12:53:22.144262Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-11T12:53:22.146215Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-11T12:53:22.154759Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-11T12:53:22.158172Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-11T12:53:22.212129Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-11T12:53:22.304744Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:22.304989Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-11T12:53:22.307389Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-11T12:53:22.469757Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-11T12:53:22.481187Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-11T12:53:22.481622Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-11T12:53:22.482185Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-11T12:53:22.533061Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 2552053
2018-02-11T12:53:22.533556Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.533812Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-11T12:53:22.591600Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180211 12:53:22
2018-02-11T12:53:22.600231Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-02-11T12:53:22.600407Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2018-02-11T12:53:22.606883Z 0 [Warning] CA certificate ca.pem is self signed.
2018-02-11T12:53:22.608530Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2018-02-11T12:53:22.611190Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-11T12:53:22.611373Z 0 [Note] IPv6 is available.
2018-02-11T12:53:22.611457Z 0 [Note] - '::' resolves to '::';
2018-02-11T12:53:22.611539Z 0 [Note] Server socket created on IP: '::'.
2018-02-11T12:53:22.620768Z 0 [ERROR] Can't start server : Bind on unix socket: Operation not permitted
2018-02-11T12:53:22.620942Z 0 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2018-02-11T12:53:22.621067Z 0 [ERROR] Aborting
2018-02-11T12:53:22.621204Z 0 [Note] Binlog end
2018-02-11T12:53:22.621421Z 0 [Note] Shutting down plugin 'ngram'
2018-02-11T12:53:22.621550Z 0 [Note] Shutting down plugin 'partition'
2018-02-11T12:53:22.621645Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2018-02-11T12:53:22.621744Z 0 [Note] Shutting down plugin 'ARCHIVE'
2018-02-11T12:53:22.621832Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2018-02-11T12:53:22.621993Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2018-02-11T12:53:22.622088Z 0 [Note] Shutting down plugin 'MyISAM'
2018-02-11T12:53:22.622199Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2018-02-11T12:53:22.622266Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2018-02-11T12:53:22.622314Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2018-02-11T12:53:22.622378Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2018-02-11T12:53:22.622426Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2018-02-11T12:53:22.622488Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2018-02-11T12:53:22.622536Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2018-02-11T12:53:22.622599Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2018-02-11T12:53:22.622647Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2018-02-11T12:53:22.622724Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2018-02-11T12:53:22.622773Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2018-02-11T12:53:22.622837Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2018-02-11T12:53:22.622885Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2018-02-11T12:53:22.622947Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2018-02-11T12:53:22.623031Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2018-02-11T12:53:22.623087Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2018-02-11T12:53:22.623143Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2018-02-11T12:53:22.623197Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2018-02-11T12:53:22.623254Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2018-02-11T12:53:22.623308Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2018-02-11T12:53:22.623363Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2018-02-11T12:53:22.623418Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2018-02-11T12:53:22.623474Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-02-11T12:53:22.623528Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-02-11T12:53:22.623648Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-02-11T12:53:22.623753Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-02-11T12:53:22.623845Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-02-11T12:53:22.623953Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-02-11T12:53:22.624004Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-02-11T12:53:22.624068Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-02-11T12:53:22.624116Z 0 [Note] Shutting down plugin 'InnoDB'
2018-02-11T12:53:22.624273Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-02-11T12:53:22.624454Z 0 [Note] InnoDB: Starting shutdown...
2018-02-11T12:53:22.724955Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.739902Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180211 12:53:22
2018-02-11T12:53:24.348445Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2552072
2018-02-11T12:53:24.352699Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:24.353012Z 0 [Note] Shutting down plugin 'MEMORY'
2018-02-11T12:53:24.353110Z 0 [Note] Shutting down plugin 'CSV'
2018-02-11T12:53:24.353214Z 0 [Note] Shutting down plugin 'sha256_password'
2018-02-11T12:53:24.353308Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-02-11T12:53:24.353542Z 0 [Note] Shutting down plugin 'binlog'
2018-02-11T12:53:24.357751Z 0 [Note] mysqld: Shutdown complete
我为每个人设置了“C:/ mysql /”权限,我该怎么办?还是忘了什么? permission
感谢Ahab帮助,当我添加标签“:rw”仍然是相同的结果无法启动服务器:绑定在unix套接字:操作不允许result1result2
答案
据https://dev.mysql.com/doc/refman/5.7/en/deploy-mysql-nonlinux-docker.html说:
引用:
如果要在容器的MySQL数据目录上进行绑定安装(有关详细信息,请参阅保留数据和配置更改),则必须使用--socket选项将服务器套接字文件的位置设置为MySQL数据目录之外的某个位置;否则,服务器将无法启动。这是因为Docker for Windows处理文件安装的方式不允许将主机文件绑定到套接字文件上。
以上是关于无法启动服务器:绑定在unix socket上:不允许操作的主要内容,如果未能解决你的问题,请参考以下文章
MySQL5.7报错[ERROR] Unix socket lock file is empty /tmp/mysql.sock.lock的解决方法