store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Sat Apr 19, 2014 12:30 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: my.cnf
Unread postPosted: Tue Jun 21, 2011 8:33 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 2006
My my.cnf on our main server (Centos 4, MySql 5.1) is in a bit of a mess. It dates back from mysql 3.x and I think the problem is that things have been added over the years, somtimes in the the wrong place.

Can someone help me tidy it up?

As you'll see, as well as a lot of lines with "set-variable" lines. Should these be replaced with "option = value" or not?

e.g. instead of "set-variable = innodb_additional_mem_pool_size=500K" should it just be
"innodb_additional_mem_pool_size=500K" ?

I'm sure I just read something about "set-variable" being deprecated as of MySQL4 but now I can't find the reference.

I also note that I have a lot of stuff in the [mysqld_safe] section, sometimes duplicating what's in [mysqld]. According to the mysql manual, the contents of [mysqld_safe] will get read along with everything in [mysqld] (and [server]) when mysqld is started with the mysqld_safe startup script.

Great, so I should move most of what's in [mysqld_safe] to [mysqld] rather than having duplicates - except that looking at an unmodified my.cnf from another server, the contents of [mysqld] and [mysqld_safe] are mostly duplicated, so maybe not! Oh, and what's this? lots of set-"variable= rather" than "option = value"! So I'm probably wrong about it being deprecated too.

my.cnf from main server:
Code:
[mysqld]

#innodb_force_recovery = 2

set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

skip-bdb


key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 3072
thread_cache_size = 64
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
max_allowed_packet = 16M
set-variable = innodb_buffer_pool_size=30M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
skip-bdb

set-variable = innodb_buffer_pool_size=30M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2




Default (almost) my.cnf from mysql 5.something on Centos 4 (I think):
Code:
[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# To allow mysqld to connect to a MySQL Cluster management daemon, uncomment
# these lines and adjust the connectstring as needed.
#ndbcluster
#ndb-connectstring="nodeid=4;host=localhost:1186"

skip-bdb

set-variable = innodb_buffer_pool_size=2M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

skip-bdb

set-variable = innodb_buffer_pool_size=2M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2

[ndbd]
# If you are running a MySQL Cluster storage daemon (ndbd) on this machine,
# adjust its connection to the management daemon here.
# Note: ndbd init script requires this to include nodeid!
connect-string="nodeid=2;host=localhost:1186"

[ndb_mgm]
# connection string for MySQL Cluster management tool
connect-string="host=localhost:1186"

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: my.cnf
Unread postPosted: Tue Jun 21, 2011 8:53 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7776
Location: earth
have you tried out mysqltuner yet?


Top
 Profile  
 
 Post subject: Re: my.cnf
Unread postPosted: Tue Jun 21, 2011 12:38 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Sat Aug 20, 2005 9:30 am
Posts: 2812
Location: The Netherlands
  • The set-variable= style has been deprecated, but I believe it still works. But I'd get rid of it.
  • You don't need to duplicate anything from [mysqld] to [mysqld_safe].

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group