my.cnf configuration options

neorder

Verified User
Joined
Oct 1, 2003
Messages
346
I found and copied these configurations to my server, but i found no where what are these options means, can anyone point to me where to find more informations about my.cnf?

what's my.cnf

It's very likely that the first task the administrator will want to undertake is proper configuration of MySQL's configuration file. This file, entitled my.cnf, stores default startup options for both the server and for clients. Correct configuration of this file can go a long way towards optimizing MySQL, as various memory buffer settings and other valuable options can be set here.

Interestingly, the scope of this file can be set according to its location. The settings will be considered global to all MySQL servers if stored in /etc/my.cnf. It will be global to a specific server if located in the directory where the MySQL databases are stored (/usr/local/mysql/data for a binary installation, or/usr/local/var for a source installation). Finally, its scope could be limited to a specific user if located in the home directory of the MySQL user (~/.my.cnf). Keep in mind that even if MySQL does locate a my.cnf file in /etc/my.cnf (global to all MySQL servers on that machine), it will continue its search for a server-specific file, and then a user-specific file. You can think of the final configuration settings as being the result of the /etc/my.cnf, mysql-data-dir/my.cnf, and ~/.my.cnf files.

In order to aid administrator's in the proper configuration of this file, the MySQL developers have included four sample my.cnf files within the distribution. Their names are my-huge.cnf.sh, my-large.cnf.sh, my-medium.cnf.sh, and my-small.cnf.sh, and each denotes recommended configuration settings in accordance with system resource availability.

[mysqld]
set-variable = max_connections=500
safe-show-database
default-character-set=utf8
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
#skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
max_user_connections=100
interactive_timeout=60
wait_timeout=60
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
thread_concurrency=8
myisam_sort_buffer_size=64M
server-id=1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M

[myisamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M
 
for example, what the right setting to limit user's database concurrent connections?

I have these settings in my.cnf, which is the one?

set-variable = max_connections=500
max_connections=500
max_user_connections=100
max_connect_errors=10
thread_concurrency=8
 
great, after reading it, I figured I should upgrade mysql to 5.1 to utilize

In MySQL 5.1, you can limit use of the following server resources for individual accounts:

The number of queries that an account can issue per hour

The number of updates that an account can issue per hour

The number of times an account can connect to the server per hour

The number of simultaneous connections to the server by an account

kindly check with you okay to add these parameters to my.cnf if I use mysql 5.1?
MAX_QUERIES_PER_HOUR 20
MAX_UPDATES_PER_HOUR 10
MAX_CONNECTIONS_PER_HOUR 5
MAX_USER_CONNECTIONS 2
 
Back
Top