Home Database Mysql Tutorial [译]中文注释 MariaDB my.cnf 大型服务器配置模板_MySQL

[译]中文注释 MariaDB my.cnf 大型服务器配置模板_MySQL

Jun 01, 2016 pm 01:13 PM
Chinese server

MariaDB

文件如下所示,请根据需要进行修改:

翻译日期: 2014年5月22日

翻译人员:铁锚

# /usr/share/mysql/my-huge.cnf # MariaDB 配置文件 示例模板(huge,巨型).## 本文件适用于专用数据库服务器, 内存为 1G-2G# 机器上主要只运行 MariaDB的大型系统 ,## MariaDB 程序会根据运行的操作系统平台查找一系列的配置文件,# 你可以将此模板配置文件拷贝到对应的位置(并重命名),# 要查看有哪些配置文件会被读取到,执行:# 'my_print_defaults --help' 并查看# Default options are read from the following files in the given order: # (--> 程序会依次读取列出的配置文件.) 这部分下面列出的文件(路径)列表.# 更多信息请参考: http://dev.mysql.com/doc/mysql/en/option-files.html## 在本文件的各个小节中,你可以使用该程序支持的所有选项.# 如果想要了解程序是否支持某个参数,# 可以使用"--help" 选项来启动该程序,查看帮助信息.# 下面一小节的配置选项由本地的所有 MySQL 客户端读取,作为默认配置[client]#password	= your_passwordport		= 3306socket		= /var/lib/mysql/mysql.sock# 下面的各个小节,由各种应用程序来读取解析# MySQL server 配置信息[mysqld]port		= 3306socket		= /var/lib/mysql/mysql.sockskip-external-lockingkey_buffer_size = 384Mmax_allowed_packet = 1Mtable_open_cache = 512sort_buffer_size = 2Mread_buffer_size = 2Mread_rnd_buffer_size = 8Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8query_cache_size = 32M# 并发线程数,建议为CPU核心数乘以2:CPU's*2 for thread_concurrencythread_concurrency = 8# 可以指定一个专用磁盘的路径来作为临时目录,例如 SSD#tmpdir		= /tmp/# 配置此参数则不启动TCP/IP 端口 监听. # 如果所有的处理程序都只在同一台机器上连接 mysqld, 这是一个很安全的做法,# 所有同 mysqld 的交互只能通过Unix sockets 或命名管道(named pipes)完成.# 注意,使用此选项而没有开启Windows上的命名管道(named pipes),# (通过 "enable-named-pipe" 配置项) 将会导致 mysqld 不可用!#skip-networking# 主服务器配置选项 Replication Master Server (default)# 在主从复制时,需要依赖二进制日志log-bin=mysql-bin# 在整个主从复制集群中要求是 1 到 2^32 - 1 之间的唯一ID, 否则或者失败,或者大量出错日志信息.# 如果没有设置 master-host,则默认值是 1# 但如果省略了,则(master)不生效server-id	= 1# 从服务器配置选项 Replication Slave (需要将 master 部分注释掉,才能使用这部分)## 要将服务器配置为从属服务器(replication slave),# 有如下两种方案可供选择 :## 1) 通过 CHANGE MASTER TO 命令 (在用户手册中有详细的描述) -#语法如下:##CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,#MASTER_USER=<user>, MASTER_PASSWORD=<password> ;##你可以将 <host>, <user>, <password> 替换为单引号括起来的字符串,#将 <port> 替换为 master 的端口号 (默认是 3306).##一个示例如下所示:##CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,#MASTER_USER='joe', MASTER_PASSWORD='secret';## 或者:## 2) 设置下面的参数. 然而, 一旦你选择了这种方式,#首次启动主从复制时 (即便启动复制失败, 如错误的 master-password 密码,#导致 slave 连接不上等), slave 将会创建一个名为 master.info 的文件,#如果以后再修改本配置文件(xxx.cnf)中下面的这些参数, 则将被忽略,#并继续使用 master.info 文件的内容, unless you shutdown#除非关闭 slave 服务器, 然后删除文件 master.info 并重新启动 slaver server.#出于这个原因, 你应该不系统修改下面的相关参数参数(带  的注释部分),#而是使用 CHANGE MASTER TO (上面的方案1)# ## 在整个主从复制集群中要求是 2 到 2^32 - 1 之间的唯一ID, # 否则或者失败,或者大量出错日志信息.# 如果设置了 master-host,则默认值是 2# 但如果省略了,则不会成为 slave #server-id = 2## 此slave 需要连接的 master. - required#master-host = <hostname>## slave连接到 master 认证时需要的 username# - 用户名是必须的(也可以在连接时指定)#master-user = <username>## slave连接到 master 认证时需要的 password# - 密码是必须的(也可以在连接时指定)#master-password = <password>## master 监听的端口号# 可选 - 默认是 3306#master-port =<port>## 开启二进制日志, 对于slave从服务器不是必须的,但推荐开启#log-bin=mysql-bin## 二进制日志格式 —— 推荐 mixed#binlog_format=mixed# 如果只使用 InnoDB 表, 请取消下列选项的注释#innodb_data_home_dir = /var/lib/mysql#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend#innodb_log_group_home_dir = /var/lib/mysql# 如果只使用 InnoDB,可以设置 .._buffer_pool_size 为物理内存的 50 - 80 %# 谨防内存使用设置得太高#innodb_buffer_pool_size = 384M# 附加缓存池大小#innodb_additional_mem_pool_size = 20M# 设置 .._log_file_size 为buffer pool size 的 25 % 左右#innodb_log_file_size = 100M# 日志缓存的大小,不要设置太大,1秒钟刷新一次#innodb_log_buffer_size = 8M# 默认1,事务提交就刷新日志到硬盘;# 设为2,刷新到操作系统缓存,但性能提高很多,设为 0 则可能丢事务.#innodb_flush_log_at_trx_commit = 1# 表死锁的超时释放时间,单位秒#innodb_lock_wait_timeout = 50[mysqldump]# 快速导出到输出流/硬盘,不在内存中缓存quick# 最大数据包限制max_allowed_packet = 16M[mysql]no-auto-rehash# 如果对 SQL不熟悉,可以将下面的注释符去掉,拒绝无where的不安全操作.#safe-updates[myisamchk]key_buffer_size = 256Msort_buffer_size = 256Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout</port></password></username></hostname></port></password></user></host></password></user></port></host>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set Chinese in Call of Duty: Warzone mobile game How to set Chinese in Call of Duty: Warzone mobile game Mar 22, 2024 am 08:41 AM

Call of Duty Warzone is a newly launched mobile game. Many players are very curious about how to set the language of this game to Chinese. In fact, it is very simple. Players only need to download the Chinese language pack, and then You can modify it after using it. The detailed content can be learned in this Chinese setting method introduction. Let us take a look together. How to set the Chinese language for the mobile game Call of Duty: Warzone 1. First enter the game and click the settings icon in the upper right corner of the interface. 2. In the menu bar that appears, find the [Download] option and click it. 3. Select [SIMPLIFIEDCHINESE] (Simplified Chinese) on this page to download the Simplified Chinese installation package. 4. Return to the settings

How to set Excel table to display Chinese? Excel switching Chinese operation tutorial How to set Excel table to display Chinese? Excel switching Chinese operation tutorial Mar 14, 2024 pm 03:28 PM

Excel spreadsheet is one of the office software that many people are using now. Some users, because their computer is Win11 system, so the English interface is displayed. They want to switch to the Chinese interface, but they don’t know how to operate it. To solve this problem, this issue The editor is here to answer the questions for all users. Let’s take a look at the content shared in today’s software tutorial. Tutorial for switching Excel to Chinese: 1. Enter the software and click the "File" option on the left side of the toolbar at the top of the page. 2. Select "options" from the options given below. 3. After entering the new interface, click the “language” option on the left

Setting up Chinese with VSCode: The Complete Guide Setting up Chinese with VSCode: The Complete Guide Mar 25, 2024 am 11:18 AM

VSCode Setup in Chinese: A Complete Guide In software development, Visual Studio Code (VSCode for short) is a commonly used integrated development environment. For developers who use Chinese, setting VSCode to the Chinese interface can improve work efficiency. This article will provide you with a complete guide, detailing how to set VSCode to a Chinese interface and providing specific code examples. Step 1: Download and install the language pack. After opening VSCode, click on the left

How to display Chinese characters correctly in PHP Dompdf How to display Chinese characters correctly in PHP Dompdf Mar 05, 2024 pm 01:03 PM

How to display Chinese characters correctly in PHPDompdf When using PHPDompdf to generate PDF files, it is a common challenge to encounter the problem of garbled Chinese characters. This is because the font library used by Dompdf by default does not contain Chinese character sets. In order to display Chinese characters correctly, we need to manually set the font of Dompdf and make sure to select a font that supports Chinese characters. Here are some specific steps and code examples to solve this problem: Step 1: Download the Chinese font file First, we need

An effective way to fix Chinese garbled characters in PHP Dompdf An effective way to fix Chinese garbled characters in PHP Dompdf Mar 05, 2024 pm 04:45 PM

Title: An effective way to repair Chinese garbled characters in PHPDompdf. When using PHPDompdf to generate PDF documents, garbled Chinese characters are a common problem. This problem usually stems from the fact that Dompdf does not support Chinese character sets by default, resulting in Chinese content not being displayed correctly. In order to solve this problem, we need to take some effective ways to fix the Chinese garbled problem of PHPDompdf. 1. Use custom font files. An effective way to solve the problem of Chinese garbled characters in Dompdf is to use

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

Will wwe2k24 have Chinese? Will wwe2k24 have Chinese? Mar 13, 2024 pm 04:40 PM

"WWE2K24" is a racing sports game created by Visual Concepts and was officially released on March 9, 2024. This game has been highly praised, and many players are eagerly interested in whether it will have a Chinese version. Unfortunately, so far, "WWE2K24" has not yet launched a Chinese language version. Will wwe2k24 be in Chinese? Answer: Chinese is not currently supported. The standard version of WWE2K24 in the Steam Chinese region is priced at 199 yuan, the deluxe version is 329 yuan, and the commemorative edition is 395 yuan. The game has relatively high configuration requirements, and there are certain standards in terms of processor, graphics card, or running memory. Official recommended configuration and minimum configuration introduction:

Best Practice Guide for Building IP Proxy Servers with PHP Best Practice Guide for Building IP Proxy Servers with PHP Mar 11, 2024 am 08:36 AM

In network data transmission, IP proxy servers play an important role, helping users hide their real IP addresses, protect privacy, and improve access speeds. In this article, we will introduce the best practice guide on how to build an IP proxy server with PHP and provide specific code examples. What is an IP proxy server? An IP proxy server is an intermediate server located between the user and the target server. It acts as a transfer station between the user and the target server, forwarding the user's requests and responses. By using an IP proxy server

See all articles