MySQLQueryCache (cache) _ MySQL

Source: Internet
Author: User
MySQLQueryCache (cache) bitsCN.com

MySQL Query Cache)

SQL code www.bitsCN.com

# Example MySQL config file for medium systems.

# The application is generated by mysql-5.1.37-win32 editing of the my-medium.ini on one machine.

# This is for a system with little memory (32 M-64 M) where MySQL plays

# An important part, or systems up to 128 M where MySQL is used together

# Other programs (such as a web server)

#

# You can copy this file

#/Etc/my. cnf to set global options,

# Mysql-data-dir/my. cnf to set server-specific options (in this

# Installation this directory is C:/mysql/data) or

#~ /. My. cnf to set user-specific options.

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# With the "-- help" option.

# The following options will be passed to all MySQL clients

# The following options will be read by the MySQL client application.

# Note that only client applications attached to MySQL can read this section.

# If you want your MySQL application to obtain these values

# Specify these options when initializing the MySQL client database

[Client]

# Password = your_password

# The default port of the mysql client is meaningless to the application. the installer does not modify this parameter.

Port = 3316

Socket =/tmp/mysql. sock

# Here follows entries for some specific programs

# MySQL server

# The MySQL server

[Mysqld]

# Database Port. the default value is 3316. the installer automatically identifies the port and selects the available port in

Port = 3316

Socket =/tmp/mysql. sock

Skip-locking

# MyISAM related options. because the storage engine INNODB is used, this segment settings are retained by default without modification.

# Keyword buffer size, which is generally used to buffer index blocks of MyISAM tables.

# Do not set it to 30% greater than your available memory,

# Because some of the memory is also used by the OS to buffer row data

# Even if you do not use the MyISAM table, you still need to set up 8-64 MB memory because it will also be used by the internal temporary disk table.

Key_buffer_size = 16 M

Max_allowed_packet = 1 M

Table_open_cache = 64

Sort_buffer_size = 512 K

Net_buffer_length = 8 K

# Buffer size used for full table scan of MyISAM table.

# Allocate data in the corresponding thread when full table scan is required.

Read_buffer_size = 256 K

# When a row is read from a sorted sequence, the row data is read from the buffer to prevent disk seek.

# If you increase this value, you can improve the performance of many order by statements.

# Allocated by each thread when necessary

Read_rnd_buffer_size = 512 K

# This buffer is allocated when MySQL needs to re-index a REPAIR, OPTIMIZE, ALTER, and load data infile to an empty table.

# This is allocated in each thread. therefore, be careful when setting the callback.

Myisam_sort_buffer_size = 8 M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,

# If all processes that need to connect to mysqld run on the same host.

# All interaction with mysqld must be made via Unix sockets or named pipes.

# Note that using this option without enabling named pipes on Windows

# (Via the "enable-named-pipe" option) will render mysqld useless!

#

# Skip-networking

# Replication Master Server (default)

# Binary logging is required for replication

# Enable the binary log function.

# In the replication configuration, this option must be enabled as the MASTER server

# If you need to recover from your last backup based on time points, you also need binary logs.

Log-bin = mysql-bin

# Binary logging format-mixed recommended

Binlog_format = mixed

# Required unique id between 1 and 2 ^ 32-1

# Defaults to 1 if master-host is not set

# But will not function as a master if omitted

# Unique service identification number, ranging from 1 to 2 ^ 32-1.

# This value must be set on both master and slave.

# If "master-host" is not set, the default value is 1. However, if this option is ignored, MySQL will not take effect as the master.

Server-id = 1

# Replication Slave (comment out master section to use this)

#

# To configure this host as a replication slave, you can choose

# Two methods:

#

#1) Use the change master to command (fully described in our manual )-

# The syntax is:

#

# Change master to MASTER_HOST = , MASTER_PORT = ,

# MASTER_USER = , MASTER_PASSWORD = ;

#

# Where you replace , , By quoted strings and

# By the master's port number (3306 by default ).

#

# Example:

#

# Change master to MASTER_HOST = '192. 564.12.1 ', MASTER_PORT = 125,

# MASTER_USER = 'job', MASTER_PASSWORD = 'secret ';

#

# OR

#

#2) Set the variables below. However, in case you choose this method, then

# Start replication for the first time (even unsuccessfully, for example

# If you mistyped the password in master-password and the slave fails

# Connect), the slave will create a master.info file, and any later

# Change in this file to the variables 'values below will be ignored and

# Overridden by the content of the master.info file, unless you shutdown

# The slave server, delete master.info and restart the slaver server.

# For that reason, you may want to leave the lines below untouched

# (Commented) and instead use change master to (see above)

#

# Required unique id between 2 and 2 ^ 32-1

# (And different from the master)

# Defaults to 2 if master-host is set

# But will not function as a slave if omitted

# Server-id = 2

#

# The replication master for this slave-required

# Master-host =

#

# The username the slave will use for authentication when connecting

# To the master-required

# Master-user =

#

# The password the slave will authenticate with when connecting

# The master-required

# Master-password =

#

# The port the master is listening on.

# Optional-defaults to 3306

# Master-port =

#

# Binary logging-not required for slaves, but recommended

# Log-bin = mysql-bin

# Point the following paths to different dedicated disks

# Tmpdir =/tmp/

# Log-update =/path-to-dedicated-directory/hostname

# Uncomment the following if you are using InnoDB tables

# Innodb_data_home_dir = C:/mysql/data/

# InnoDB stores data in one or more data files as tablespaces.

# If you only have a single logic driver to save your data, a single auto-increment file is enough.

# In other cases, a file on each device is generally a good choice.

# You can also configure InnoDB to use the raw disk partition.-refer to the manual for more information.

Innodb_data_file_path = ibdata1: 10 M: autoextend

# Innodb_log_group_home_dir = C:/mysql/data/

# You can set .. _ buffer_pool_size up to 50-80%

# Of RAM but beware of setting memory usage too high

# InnoDB uses a buffer pool to store indexes and raw data, unlike MyISAM.

# The larger you set, the less disk I/O you need to access the data in the table.

# On an independently used database server, you can set this variable to 80% of the server's physical memory size

# Do not set too large. Otherwise, the physical memory competition may lead to page change bumps in the operating system.

# Note that on a 32-bit system, each process may be limited to 2-3.5 GB of user memory,

# Do not set it too high.

Innodb_buffer_pool_size = 64 M

# The additional memory pool is used by InnoDB to save metadata information

# If InnoDB requires more memory for this purpose, it will apply for memory from the OS.

# Because this operation is fast enough in most modern operating systems, you generally do not need to modify this value.

# The show innodb status command displays the number of times used first.

Innodb_additional_mem_pool_size = 2 M

# Set .. _ log_file_size to 25% of buffer pool size

# Size of each log file in the log Group.

# You should set the total size of log files to 25% ~ of the size of your buffer pool ~ 100%

# Avoid writing unnecessary refresh actions in the buffer pool in the log file.

# In any case, note that a large log file size will increase the time required to restore the process.

Innodb_log_file_size = 32 M

# Buffer size used to buffer log data.

# When the value is full, InnoDB must refresh the data to the disk.

# Since refresh is basically performed every second, it is not necessary to set this value too large (even for long transactions)

Innodb_log_buffer_size = 8 M

# If it is set to 1, InnoDB will refresh the (fsync) transaction log to the disk after each commit,

# This provides complete ACID behavior.

# If you are willing to compromise transaction security and you are running a small item, you can set this value to 0 or 2 to reduce disk I/O caused by transaction logs

#0 indicates that logs are only written to the log file every second and the log file is refreshed to the disk.

#2 indicates that the log file written to the log is refreshed to the disk only every second after each submission.

Innodb_flush_log_at_trx_commit = 1

# How long should an InnoDB transaction wait for a lock to be approved before being rolled back.

# InnoDB automatically detects the transaction deadlock and rolls back the transaction in its lock table.

# If you use the lock tables command, or use the transaction security storage engine www.bitsCN.com other than InnoDB in the same transaction

# A deadlock may occur and InnoDB cannot notice it.

# In this case, the timeout value is very helpful for solving this problem.

Innodb_lock_wait_timeout = 50

# -------- Custom settings ----------

# Set the installation directory of mysql

Basedir = c:/Program Files/MySQL

# Set the data storage directory of the mysql database, which must be data or/xxx-data

Datadir = c:/Program Files/MySQL/data

# Set the character set of the mysql server, default encoding

Default-character-set = utf8

# To restore the SQL file of a database, if it contains a view and storage structure, you must add

# Log-bin-trust-function-creators = 1

# Use the following statement to change the default storage engine InnoDB

Default-storage-engine = INNODB

# Exclusive tablespace of The InnoDB storage engine

Innodb_file_per_table = 1

# How many threads are reserved in the cache for reuse

# When a client is disconnected, if the cache thread is smaller than thread_cache_size,

# The client thread is put into the cache.

# This can greatly reduce the thread creation overhead when you need a large number of new connections

# (Generally, if you have a good thread model, this will not significantly improve the performance.) www.bitsCN.com

Thread_cache_size = 8

[Mysqldump]

Quick

Max_allowed_packet = 16 M

[Mysql]

No-auto-rehash

# Remove the next comment character if you are not familiar with SQL

# Safe-updates

[Myisamchk]

Key_buffer_size = 20 M

Sort_buffer_size = 20 M

Read_buffer = 2 M

Write_buffer = 2 M

[Mysqlhotcopy]

Interactive-timeout

[WinMySQLAdmin]

# Specify the mysql service startup file

Server = c:/Program Files/MySQL/bin/mysqld.exe

How to register the MySQL service:

Modify the corresponding path and run it in CMD.

"D:/Program Files/mysql-5.5.14-win32/bin/mysqld.exe" -- install MySQL -- defaults-file = "D:/Program Files/mysql-5.5.14-win32/my. ini"

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.