top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Tuning MySQL - what's the best place for mysqld parameters?

+1 vote

For a Wordpress website I have installed mysql-server-5.1.69-1.el6_4.x86_64 and run /usr/bin/mysql_secure_installation on a CentOS 6.4 machine with mucho RAM (32 GB) and I wonder, what would be the best place for the mysqld parameters descibed at

mysqld_safe --key_buffer_size=64M --table_open_cache=256  --sort_buffer_size=4M --read_buffer_size=1M &

Should I just edit the file /etc/init.d/mysqld or is there a better place in CentOS for that (under sysconfig?)

posted Nov 11, 2013 by Anderson

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Don't touch the init script. It would get overridden by a future package update.

/etc/my.cnf is the configuration file where you add all the desired tuning options. It will not be touched by an update.

For your help the mysql-server package ships with example configurations for different setups:

answer Nov 11, 2013 by Majula Joshi
Similar Questions
+2 votes

I have a rails application, in which I am using delayed_job_active_record gem for running background jobs. While using the method .delay with an object, I am getting the following mysql error:


I already searched for the above error and found that its because of the difference in encoding in mysql and rails. The solution suggested by many programmers is to alter the encoding in mysql database to utf8. But I also read that MySQL's utf8 charset only partially implements proper UTF-8 encoding. It can only store UTF-8-encoded symbols that consist of one to three bytes; encoded symbols that take up four bytes aren't supported. Which might cause trouble in some other cases. Also, when I tried to insert the value directly in mysql, it worked like a charm. Suggesting that the issue might lie elsewhere. So, can anyone please suggest the right method to rectify this problem?

Any help would be greatly appreciated.

0 votes

Server running Centos and MySQL and Client is a windows xp machine.
I have setup a SSH tunnel with putty and run mysql administrator. It works fine with the root account.

With a non-root account I get
the server service or the configuration file could not be found. I can log on but I can't see the databases that I should be allowed to see.

Running a mysql -h -u myuser -p mypassword from linux works fine

I have created a .my.cnf file in the home folder with 600 permissions in the linux box and filled it with:


Server configuration file is under /etc/my.cnf. What am I doing wrong?

0 votes

I am trying to understand the incredible use of filepointers in our mysql server (5.1.53). under normal condition the server reports 10k-15k open files pointer. I run a 'flush tables' every 2h to avoid problems, the number of users/connections is constant
It is an automatic system but a few human users, a happy mix of myisam and innodb tables running
with no problems on mysqld 5.0 . But now sometimes i am hit with an insane increase hitting the ceiling at 60k. I do not like the idea to increase the limit further because i do not understand why this is happening (I seems to happen at random times).

I am running out of idea what my cause the unexpected increase, any idea what to watch ?

0 votes

I'm attempting to move away from PHP mysql functions to something newer, either mysqli or PDO.

I have read various things about them, but I'm curious at this point which would be best to learn for the present and future. I'm usually working on small to medium size projects.

I understand that PDO has an extra abstraction layer so it can work with / convert to other databases like oracle and others fairly easily, but some have said that PDO can be a bit slower the MySQLi?

So I would really like to hear opinions on the best choices of either MySQLi or PDO.

Also I'm also trying to learn OOP, so I'm looking for a very good working PDO and/or mysqli database class - to get started with, that has all the basic needs like UPDATE - INSERT - DELETE - QUERY etc. That would be very helpful.

+1 vote

Assume there is one database in a system having multiple processes that are accessing this database.
If one process updates database table other processes should be notified. If someone has MySql C APIs document please send me.
Thanks in advance.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.