1.2.3 Using Option Files

MySQL Option File配置

1.作为一个可选的指定参数在命令行,可以放置他们在一个可选的文件中。Mysql在启动时查看可选文件。Option在option file被组织成组,每个都以一个组名命名组。例如[mysql]和[mysqldump]组被用使用有mysql和mysqldump。这个[client]被指定选项,所有的client程序来使用。如下

[client]

host=myhost.example.com

[mysql]

safe-updates

option file被放置在哪里取决于操作系统,在windows,程序查询option file在下面的顺序,my.ini ,my.cnf

在unix,这文件/etc/my.cnf 作为一个全局的可选文件有所有的用户使用。创建.my.cnf的文件建立自己用户指定的可选文件。如果同时存在,全局的优先。

使用一个可选文件,创建它作为一个文本文件。为了创建和修改一个可选的文件,必须能够有些的权限。client程序仅仅需要读权限。

为了代替标准的可选文件,使用--default-file=file_name选项作为第一选项在命令行。如果出了读取标准的可选文件外,使用--default-extra-file=file_name选项作为第一选项在命令行。如果告诉程序忽略所有的选项文件,指定--no-defaults作为第一选项在命令行。

选项文件能够应用其他的文件通过!include和!includedir命令


~ $ pip install numpy scipy pandas Collecting numpy Using cached numpy-2.3.2.tar.gz (20.5 MB) Installing build dependencies ... error error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 2 ╰─> [83 lines of output] Collecting meson-python>=0.15.0 Using cached meson_python-0.18.0-py3-none-any.whl.metadata (2.8 kB) Collecting Cython>=3.0.6 Using cached cython-3.1.3-py3-none-any.whl.metadata (4.5 kB) Collecting meson>=1.2.3 (from meson-python>=0.15.0) Downloading meson-1.9.0-py3-none-any.whl.metadata (1.8 kB) Collecting packaging>=23.2 (from meson-python>=0.15.0) Using cached packaging-25.0-py3-none-any.whl.metadata (3.3 kB) Collecting pyproject-metadata>=0.9.0 (from meson-python>=0.15.0) Using cached pyproject_metadata-0.9.1-py3-none-any.whl.metadata (7.0 kB) Using cached meson_python-0.18.0-py3-none-any.whl (28 kB) Using cached cython-3.1.3-py3-none-any.whl (1.2 MB) Downloading meson-1.9.0-py3-none-any.whl (1.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 8.1 kB/s eta 0:00:06 ERROR: Exception: Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher yield File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 561, in read data = self._fp_read(amt) if not fp_closed else b"" ^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 527, in _fp_read return self._fp.read(amt) if amt is not None else self._fp.read() ^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 98, in read data: bytes = self.__fp.read(amt) ^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/http/client.py", line 479, in read s = self.fp.read(amt) ^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/socket.py", line 720, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/ssl.py", line 1251, in recv_into return self.read(nbytes, buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/ssl.py", line 1103, in read return self._sslobj.read(len, buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BrokenPipeError: [Errno 32] Broken pipe During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper status = _inner_run() ^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run return self.run(options, args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 71, in wrapper return func(self, options, args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 407, in run requirement_set = resolver.resolve( ^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 184, in resolve self.factory.preparer.prepare_linked_requirements_more(reqs) File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 564, in prepare_linked_requirements_more self._complete_partial_requirements( File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 479, in _complete_partial_requirements for link, (filepath, _) in batch_download: File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/network/download.py", line 184, in batch filepath, content_type = self(link, location) ^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/network/download.py", line 195, in __call__ self._process_response(download, resp) File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/network/download.py", line 212, in _process_response for chunk in chunks: File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py", line 67, in _rich_download_progress_bar for chunk in iterable: File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_internal/network/utils.py", line 65, in response_chunks for chunk in response.raw.stream( File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 622, in stream data = self.read(amt=amt, decode_content=decode_content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 560, in read with self._error_catcher(): File "/data/data/com.termux/files/usr/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 455, in _error_catcher raise ProtocolError("Connection broken: %r" % e, e) pip._vendor.urllib3.exceptions.ProtocolError: ("Connection broken: BrokenPipeError(32, 'Broken pipe')", BrokenPipeError(32, 'Broken pipe')) [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 2 ╰─> See above for output.
08-27
2025-06-19 12:25:09 7716 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_wcs/baglifeinfo uses space ID: 2 at filepath: .\db_wcs\baglifeinfo.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd InnoDB: We do not continue the crash recovery, because the table may become InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions. InnoDB: 2) If the table is not needed, or you can restore it from a backup, InnoDB: then you can remove the .ibd file, and InnoDB will do a normal InnoDB: crash recovery and ignore that table. InnoDB: 3) If the file system or the disk is broken, and you cannot remove InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to continue crash recovery here. 2025-06-19 12:25:10 9448 [Note] Plugin 'FEDERATED' is disabled. 2025-06-19 12:25:10 224c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2025-06-19 12:25:10 9448 [Note] InnoDB: Using atomics to ref count buffer pool pages 2025-06-19 12:25:10 9448 [Note] InnoDB: The InnoDB memory heap is disabled 2025-06-19 12:25:10 9448 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-19 12:25:10 9448 [Note] InnoDB: Memory barrier is not used 2025-06-19 12:25:10 9448 [Note] InnoDB: Compressed tables use zlib 1.2.3 2025-06-19 12:25:10 9448 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-19 12:25:10 9448 [Note] InnoDB: Initializing buffer pool, size = 8.0G 2025-06-19 12:25:10 9448 [Note] InnoDB: Completed initialization of buffer pool 2025-06-19 12:25:10 9448 [Note] InnoDB: Highest supported file format is Barracuda. 2025-06-19 12:25:10 9448 [Note] InnoDB: Log scan progressed past the checkpoint lsn 31950847983 2025-06-19 12:25:10 9448 [Note] InnoDB: Database was not shutdown normally! 2025-06-19 12:25:10 9448 [Note] InnoDB: Starting crash recovery. 2025-06-19 12:25:10 9448 [Note] InnoDB: Reading tablespace information from the .ibd files... 2025-06-19 12:25:10 9448 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_wcs/baglifeinfo uses space ID: 2 at filepath: .\db_wcs\baglifeinfo.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd InnoDB: We do not continue the crash recovery, because the table may become InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions. InnoDB: 2) If the table is not needed, or you can restore it from a backup, InnoDB: then you can remove the .ibd file, and InnoDB will do a normal InnoDB: crash recovery and ignore that table. InnoDB: 3) If the file system or the disk is broken, and you cannot remove InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to continue crash recovery here. 2025-06-19 12:25:12 7396 [Note] Plugin 'FEDERATED' is disabled. 2025-06-19 12:25:12 2484 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2025-06-19 12:25:12 7396 [Note] InnoDB: Using atomics to ref count buffer pool pages 2025-06-19 12:25:12 7396 [Note] InnoDB: The InnoDB memory heap is disabled 2025-06-19 12:25:12 7396 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-19 12:25:12 7396 [Note] InnoDB: Memory barrier is not used 2025-06-19 12:25:12 7396 [Note] InnoDB: Compressed tables use zlib 1.2.3 2025-06-19 12:25:12 7396 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-19 12:25:12 7396 [Note] InnoDB: Initializing buffer pool, size = 8.0G 2025-06-19 12:25:12 7396 [Note] InnoDB: Completed initialization of buffer pool 2025-06-19 12:25:12 7396 [Note] InnoDB: Highest supported file format is Barracuda. 2025-06-19 12:25:12 7396 [Note] InnoDB: Log scan progressed past the checkpoint lsn 31950847983 2025-06-19 12:25:12 7396 [Note] InnoDB: Database was not shutdown normally! 2025-06-19 12:25:12 7396 [Note] InnoDB: Starting crash recovery. 2025-06-19 12:25:12 7396 [Note] InnoDB: Reading tablespace information from the .ibd files... 2025-06-19 12:25:12 7396 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_wcs/baglifeinfo uses space ID: 2 at filepath: .\db_wcs\baglifeinfo.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd InnoDB: We do not continue the crash recovery, because the table may become InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions. InnoDB: 2) If the table is not needed, or you can restore it from a backup, InnoDB: then you can remove the .ibd file, and InnoDB will do a normal InnoDB: crash recovery and ignore that table. InnoDB: 3) If the file system or the disk is broken, and you cannot remove InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to continue crash recovery here. 2025-06-19 12:25:13 1704 [Note] Plugin 'FEDERATED' is disabled. 2025-06-19 12:25:13 2d94 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2025-06-19 12:25:13 1704 [Note] InnoDB: Using atomics to ref count buffer pool pages 2025-06-19 12:25:13 1704 [Note] InnoDB: The InnoDB memory heap is disabled 2025-06-19 12:25:13 1704 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-19 12:25:13 1704 [Note] InnoDB: Memory barrier is not used 2025-06-19 12:25:13 1704 [Note] InnoDB: Compressed tables use zlib 1.2.3 2025-06-19 12:25:13 1704 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-19 12:25:13 1704 [Note] InnoDB: Initializing buffer pool, size = 8.0G 2025-06-19 12:25:13 1704 [Note] InnoDB: Completed initialization of buffer pool 2025-06-19 12:25:13 1704 [Note] InnoDB: Highest supported file format is Barracuda. 2025-06-19 12:25:13 1704 [Note] InnoDB: Log scan progressed past the checkpoint lsn 31950847983 2025-06-19 12:25:13 1704 [Note] InnoDB: Database was not shutdown normally! 2025-06-19 12:25:13 1704 [Note] InnoDB: Starting crash recovery. 2025-06-19 12:25:13 1704 [Note] InnoDB: Reading tablespace information from the .ibd files... 2025-06-19 12:25:13 1704 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_wcs/baglifeinfo uses space ID: 2 at filepath: .\db_wcs\baglifeinfo.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd InnoDB: We do not continue the crash recovery, because the table may become InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions. InnoDB: 2) If the table is not needed, or you can restore it from a backup, InnoDB: then you can remove the .ibd file, and InnoDB will do a normal InnoDB: crash recovery and ignore that table. InnoDB: 3) If the file system or the disk is broken, and you cannot remove InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to continue crash recovery here. 这是一开始的报错日志信息,请帮忙分析报错1067的原因
06-20
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值