CentOS Yum installation mysql5.5 and MySQL configuration instructions my.cnf

Source: Internet
Author: User
Tags current time mysql client reserved unique id centos dell r710

1, install the MySQL 5.5.x yum source
RPM-UVH http://repo.webtatic.com/yum/centos/5/latest.rpm
2, the installation of MySQL client Support package:
Yum Install libmysqlclient15--enablerepo=webtatic
3, uninstall the old version of MySQL software package:
Yum Remove MySQL mysql-*
4, install the MySQL 5.5 client and service end:
Yum Install mysql55 mysql55-server--enablerepo=webtatic
5, start the MySQL system services, update the database:
/etc/init.d/mysqld restart
PS: This profile is for Dell R710, dual Xeon E5620, 16G memory hardware configuration. CentOS 5.6 64-bit system, MySQL 5.5.x stable version. Applies to the day IP 50-100W,PV 100-300w site, mainly uses the InnoDB storage engine. For other application environments, set the optimization according to the actual situation.
# The following options will be read by the MySQL client application.
# Note Only the client application included with MySQL guarantees that this content can be read.
# If you want to get these values from your own MySQL application.
# These options need to be specified when the MySQL client library is initialized.
#
[Client]
#password = [Your_password]
Port = @MYSQL_TCP_PORT @
Socket = @MYSQL_UNIX_ADDR @
# * * * Apply Customization options * * *
#
# MySQL Service Side
#
[Mysqld]
# General configuration Options
Port = @MYSQL_TCP_PORT @
Socket = @MYSQL_UNIX_ADDR @
# Back_log is the number of connections the operating system can hold in the listening queue.
# The queue holds the connection before the MySQL Connection Manager thread is processed.
# If you have a very high connection rate and ' connection refused ' error,
# You should add the value here.
# Check your operating system documentation to get the maximum value for this variable.
# If you set the Back_log to a higher value than your operating system, there will be no effect.
Back_log = 300
# Do not listen on TCP/IP ports.
# If all the processes are connected to the local mysqld on the same server,
# This setting will be a way to enhance security www.linuxidc.com
# All MYSQLD connections are made through UNIX sockets or named pipes.
# Note that if you do not open the Named pipe option on Windows, you only use this item
# (through the "enable-named-pipe" option) will cause the MySQL service to have no effect!
#skip-networking
# The maximum number of simultaneous sessions allowed by the MySQL service
# One of the connections will be reserved by super privileges as an administrator.
# even if the number of connections has reached the upper limit.
Max_connections = 3000
# The maximum number of error allowed per client connection, if this limit is reached.
# This client will be blocked by the MySQL service until the "FLUSH HOSTS" or service reboot is performed.
# an illegal password and other errors at the time of the link increase this value.
# View the "aborted_connects" status to get the global counter.
Max_connect_errors = 30
# Number of tables opened by all threads.
# Increasing this value increases the number of file descriptors required for mysqld
# so you need to make sure that the "open-files-limit" variable set in [Mysqld_safe] has a minimum number of open files allowed at least 4096
Table_cache = 4096
# Allow external file-level locks. Opening a file lock can adversely affect performance
# so use this option only if you are running multiple database instances on the same file (note that there are still other constraints!)
# or you use some other software dependencies on the file level to lock the MyISAM table
#external-locking
# The maximum size of the request package that the service can handle and the maximum request size that the service can handle (is necessary when working with large BLOB fields)
# The size of each connection is independent. Dynamic Increase in size
Max_allowed_packet = 32M
# Binlog in a transaction to record the cache size held by the SQL state
# If you often use large, multiple-declaration transactions, you can increase this value to achieve greater performance.
# All engaged states will be buffered in Binlog buffers and then written to Binlog once committed
# If the transaction is larger than this value, a temporary file on disk will be used instead.
# This buffer is created when each connected transaction is first updated state
Binlog_cache_size = 4M
# The maximum allowable capacity of a separate memory table.
# This option to prevent accidental creation of an oversized memory table causes all memory resources to be exhausted.
Max_heap_table_size = 128M
# The sort buffer is used to handle the sort that is caused by the order by and the group by queue
# If the sorted data cannot be placed in the sort buffer,
# A disk-based merge classification that is used for substitution
# View the ' sort_merge_passes ' state variable.
# is assigned by each thread when the sort occurs
Sort_buffer_size = 16M
# This buffer is used to optimize the Union (full joins union without indexes).
# Similar unions have very poor performance in most cases,
# but setting this value large can mitigate the performance impact.
# View the number of total unions through the ' Select_full_join ' state variable
# When a full union occurs, it is allocated in each thread
Join_buffer_size = 16M
# How many threads we keep in the cache for reuse
# When a client disconnects, if the thread in the cache is less than thread_cache_size,
# The client thread is placed in the cache.
# This can greatly reduce the overhead of thread creation when you need a lot of new connections
# (in general, if you have a good threading model, there's no noticeable performance boost.)
Thread_cache_size = 16
# This allows the application to give the thread system a hint at the same time given the number of threads that are eager to be run.
# This value is only meaningful for systems that support the thread_concurrency () function (for example, Sun Solaris).
# you can try using [CPU number]* (2..4) as thread_concurrency value
Thread_concurrency = 8
# query buffering is often used to buffer the results of a SELECT and to no longer perform direct return results the next time the same query is made.
# Open query buffering can greatly improve server speed, if you have a large number of the same query and rarely modify the table.
# Check the "qcache_lowmem_prunes" state variable to see if the current value is high enough for your load.
# Note: When your table changes frequently or if your query text is different each time,
# query buffering may cause performance degradation rather than performance improvement.
Query_cache_size = 128M
# Only a result that is less than this setting will be buffered
# This setting protects the query buffer and prevents a large result set from overwriting all other query results.
Query_cache_limit = 4M
# The smallest word length that is indexed by Full-text retrieval.
# You may want to reduce it if you need to search for shorter words.
# Note that after you modify this value,
# You need to rebuild your fulltext index
Ft_min_word_len = 8
# If your system supports the Memlock () function, you may want to turn on this option to allow the running MySQL to lock in memory and prevent possible swapping out of memory when it is highly stressful.
# This option is good for performance
#memlock
# The table type used as the default when creating new tables.
# This value will be used when creating representations that do not specifically perform table types
Default_table_type = MYISAM
# The heap size used by the thread. Memory for this capacity is reserved for each connection.
# MySQL itself often does not require more than 64K of memory
# If you use your own UDF function that requires a lot of heaps
# or your operating system needs more heaps for some operations,
# You might want to set it up a little bit higher.
Thread_stack = 512K
# Set the default transaction isolation level. The available levels are as follows:
# read-uncommitted, read-committed, Repeatable-read, SERIALIZABLE
Transaction_isolation = Repeatable-read
# The maximum size of an internal (in-memory) temporary table
# If a table grows larger than this, it will automatically be converted to a disk-based table.
# This limit is for a single table, not a sum.
Tmp_table_size = 128M
# turn on the binary log feature.
# In a replication (replication) configuration, you must open this key as the Master master server
# If you need to do a point-in-time restore from your last backup, you also need binary logging.
Log-bin=mysql-bin
# If you're using a chained copy mode from the server structure (A->B->C),
# You need to open this item on Server B.
# This option opens a log of updates that have been redo from the thread.
# and writes it to the binary log from the server.
#log_slave_updates
# Open full query log. All queries received by the server (even for a query with an incorrect syntax)
# will be recorded. This is useful for debugging, which is often turned off in a production environment.
#log
# Prints warnings to the error log file. If you have any questions about MySQL,
# You should turn on the warning log and examine the error log carefully to find out the probable cause.
#log_warnings
# Record slow queries. A slow query refers to a query that consumes more time than the "long_query_time" definition.
# If Log_long_format is opened, queries that do not use the index are also logged.
# If you often add new queries to existing systems. This is generally a good idea,
Log_slow_queries
# All the queries that use more than this time (in seconds) are considered slow queries.
# do not use "1″" here, otherwise it will cause all queries, even very fast query pages to be recorded (since MySQL's current time accuracy can only reach the second level).
Long_query_time = 6
# More information is logged in the slow log.
# generally this item is best opened.
# Open this record so that queries that do not use the index are also attached to the slow log as a slow-speed query.
Log_long_format
# This directory is used by MySQL to save temporary files. For example,
# It is used to handle large disks based sorting, as well as internal sorting.
# and a simple temporary table.
# If you don't create very large temporary files, it might be better to put them on the Swapfs/tmpfs file system
# Another option is that you can also place it on a separate disk.
# you can use '; ' To place multiple paths
# They will be polled in accordance with the Roud-robin method.
#tmpdir =/tmp
# * * * Master copy-related settings
# Unique service identification number located between 1 and 2^32-1.
# This value needs to be set on both master and slave.
# if "Master-host" is not set, the default is 1, but if this option is omitted, MySQL does not take effect as master.
Server-id = 1
# copied slave (remove the comment from Master section to make it effective)
#
# To configure this host as a replicated slave server, you can choose between two methods:
#
# 1 using the Change MASTER to command (complete description in our manuals)-
# The syntax is as follows:
#
# change MASTER to master_host=, master_port=,
# master_user=, master_password=;
#
# You need to replace, wait for the field surrounded by angle brackets and the port number that uses master (default 3306).
#
Example
#
# change MASTER to Master_host= ' 125.564.12.1′, master_port=3306,
# master_user= ' Joe ', master_password= ' secret ';
#
# or
#
# 2) Set the following variables. Anyway, in case you choose this method, and then the first time you start replication (or even unsuccessful,
# For example if you enter the wrong password in the Master-password field and slave cannot connect to it,
# Slave will create a master.info file, and any subsequent changes to the parameters contained within this file will be ignored
# and covered by the contents of the Master.info file, unless you turn off the slave service, delete the master.info, and restart the slave service.
# for this reason, you may not want to touch the configuration (commented out) and use change MASTER to (view above) instead
#
# The unique ID number required is between 2 and 2^32–1
# (and different from master)
# If the master-host is set. The default value is 2
# but if omitted, it will not take effect
#server-id = 2
#
# The master– in the copy structure must be
#master-host =
#
# The user name slave is used to authenticate when connecting to master-must be
#master-user =
#
# The password that slave uses to authenticate when connecting to master-must be
#master-password =
#
# Master listens on the port.
# optional-Default is 3306
#master-port =
# makes slave read only. Only the user has the Super privilege and the slave thread on top can modify the data.
# You can use this to ensure that no application will accidentally modify slave instead of data on master
#read_only

Related Article

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.