Example my.cnf: installing mysql
If you install mysql for a high traffic / high load site on Linux, there are some things to have in mind.
MySQL has no final example my.cnf config file! It all depends on your goals and your coding! But I have learned some important things about the database setup, I want to share with you:
1. Very important is the version of the database you use. MySQL5 and MySQL4 are two different applications. In terms of SQL statements, you might be able to cope with both, but MySQL5 (for example) has VIEWS (virtual tables), which were still missing in Version 4.
2. It is also important, if you run MySQL on Windows, Linux or another Un*x flavour and the bit bandwidth of your server processor. For a database, 64bit is to prefer!
3. On 32bit machines, MySQL might crash, if you put the wrong values into your config file. Especially the “sort_buffer” is an important variable, which could kill your database server. The sort_buffer in mysql is used to select the keys (e.g. for sorting) from a table.
The most common error, fellow webmasters make, is the high setting of this value. They forget, that the database server takes that memory for every thread of the application, and if you enter 32MB for that value and you have 100 active connections to the database, you better have 3.2 gigabytes of RAM ready! Only possible on 64bit!
Take a look at your database config and calc the values of the maximum needed RAM. If you are on 32bit, you should never be above 2 Gigs!

