apmsoso 发表于 2019-7-11 00:19:09

mysql数据目录下 .err .pid 文件如何修改

请问我事先将 /usr/local/mysql/var/ 备份了一份到宿主机,然后使用docker 挂载 目录var 到容器中,发现MySQL服务启动不了,查看 /usr/local/mysql/var/ 下没有.err .pid文件(或者重新生产了新的文件名)



请问这两个文件可以修改位置吗?或者又其他好办法可以将数据库目录挂载的宿主机的,谢谢老大。

licess 发表于 2019-7-11 08:49:13

和err、pid没任何关系,mysql都没发启动肯定没pid文件

按反馈必读反馈信息

apmsoso 发表于 2019-7-11 16:54:38

licess 发表于 2019-7-11 08:49
和err、pid没任何关系,mysql都没发启动肯定没pid文件

按反馈必读反馈信息

root@6c2706d3986c:/usr/local/mysql/var# vim 6c2706d3986c.err
2019-07-11T08:30:12.853486Z 0 Shutting down plugin 'INNODB_TRX'
2019-07-11T08:30:12.853495Z 0 Shutting down plugin 'InnoDB'
2019-07-11T08:30:12.853648Z 0 InnoDB: FTS optimize thread exiting.
2019-07-11T08:30:12.853821Z 0 InnoDB: Starting shutdown...
2019-07-11T08:30:12.954180Z 0 InnoDB: Dumping buffer pool(s) to /usr/local/mysql/var/ib_buffer_pool
2019-07-11T08:30:12.954651Z 0 InnoDB: Buffer pool(s) dump completed at 1907118:30:12
2019-07-11T08:30:14.944072Z 0 InnoDB: Shutdown completed; log sequence number 4628965
2019-07-11T08:30:14.947010Z 0 InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-07-11T08:30:14.947030Z 0 Shutting down plugin 'MEMORY'
2019-07-11T08:30:14.947041Z 0 Shutting down plugin 'CSV'
2019-07-11T08:30:14.947050Z 0 Shutting down plugin 'sha256_password'
2019-07-11T08:30:14.947056Z 0 Shutting down plugin 'mysql_native_password'
2019-07-11T08:30:14.947236Z 0 Shutting down plugin 'binlog'
2019-07-11T08:30:14.951300Z 0 /usr/local/mysql/bin/mysqld: Shutdown complete

2019-07-11T08:30:16.632891Z 0 --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2019-07-11T08:30:16.632996Z 0 /usr/local/mysql/bin/mysqld (mysqld 5.7.26) starting as process 1180 ...
2019-07-11T08:30:16.670568Z 0 InnoDB: PUNCH HOLE support available
2019-07-11T08:30:16.670647Z 0 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-07-11T08:30:16.670655Z 0 InnoDB: Uses event mutexes
2019-07-11T08:30:16.670663Z 0 InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-07-11T08:30:16.670670Z 0 InnoDB: Compressed tables use zlib 1.2.11
2019-07-11T08:30:16.670677Z 0 InnoDB: Using Linux native AIO
2019-07-11T08:30:16.671200Z 0 InnoDB: Number of pools: 1
2019-07-11T08:30:16.671346Z 0 InnoDB: Using CPU crc32 instructions
2019-07-11T08:30:16.673857Z 0 InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2019-07-11T08:30:16.755279Z 0 InnoDB: Completed initialization of buffer pool
2019-07-11T08:30:16.773436Z 0 InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-07-11T08:30:16.787585Z 0 InnoDB: Highest supported file format is Barracuda.
2019-07-11T08:30:16.854614Z 0 InnoDB: Creating shared tablespace for temporary tables
2019-07-11T08:30:16.854839Z 0 InnoDB: Setting file '/usr/local/mysql/var/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-07-11T08:30:17.028899Z 0 InnoDB: File '/usr/local/mysql/var/ibtmp1' size is now 12 MB.
2019-07-11T08:30:17.030721Z 0 InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-07-11T08:30:17.030754Z 0 InnoDB: 32 non-redo rollback segment(s) are active.
2019-07-11T08:30:17.031738Z 0 InnoDB: 5.7.26 started; log sequence number 4628965
2019-07-11T08:30:17.031981Z 0 InnoDB: Loading buffer pool(s) from /usr/local/mysql/var/ib_buffer_pool
2019-07-11T08:30:17.032378Z 0 Plugin 'FEDERATED' is disabled.
2019-07-11T08:30:17.036484Z 0 InnoDB: Buffer pool(s) load completed at 1907118:30:17
2019-07-11T08:30:17.037360Z 0 Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2019-07-11T08:30:17.037396Z 0 Server hostname (bind-address): '*'; port: 3306
2019-07-11T08:30:17.037475Z 0 IPv6 is available.
2019-07-11T08:30:17.037494Z 0    - '::' resolves to '::';
2019-07-11T08:30:17.037538Z 0 Server socket created on IP: '::'.
2019-07-11T08:30:17.067821Z 0 Failed to start slave threads for channel ''
2019-07-11T08:30:17.079199Z 0 Event Scheduler: Loaded 0 events
2019-07-11T08:30:17.079557Z 0 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.7.26'socket: '/tmp/mysql.sock'port: 3306Source distribution
2019-07-11T08:34:01.824634Z 2 IP address '172.17.0.1' could not be resolved: Name or service not known
"6c2706d3986c.err" 133L, 11525C                                                                                 

apmsoso 发表于 2019-7-11 17:03:56

本帖最后由 apmsoso 于 2019-7-11 17:06 编辑

licess 发表于 2019-7-11 08:49
和err、pid没任何关系,mysql都没发启动肯定没pid文件

按反馈必读反馈信息
你好,我容器启动时候nginx,mysql,php 都没有自动开启,需要手动start可以启动,并且mysql 生成了一个新pid文件(图一),但是我把数据库var mv 到另一个地方,然后 ln -s 过来 再重启,报错了(图2),新生成的pid 也没有了,日志文件如上。谢谢(图一)(图2)

licess 发表于 2019-7-11 20:13:30

apmsoso 发表于 2019-7-11 17:03
你好,我容器启动时候nginx,mysql,php 都没有自动开启,需要手动start可以启动,并且mysql 生成了一个新p ...

提供的日志只是部分的,发出的部分没有错误信息
pid名字本来就是根据机器名而定的
你直接拷贝数据库目录也是可能会造成损坏
页: [1]
查看完整版本: mysql数据目录下 .err .pid 文件如何修改