One thing I noticed when setting up the MySQL database was the amount of RAM that it was using on my server. It seems that when you install MySQL it is fully featured and set up for much bigger useage than your average webserver requires. My initial install was using over 100Mb. What we need to do reduce it is to create a configuration file that MySQL looks for when it starts up. In our initial webserver setup we don’t have one, so the MySQL database server starts with defaults.
To create this file from the command line you need to open up a command line text editor. There are a few about, nano, pico, vim etc. My preferred one is vim. Basically to create a file in vim you just need to start vim and state the file path. As MySQL looks for it’s config file called
my.cnf in the
/etc folder we simply type;
Now pressing i to start insert mode on the vi text editor we can type, or copy depending on what system you are using, the following text into our my.cnf document.
Save the file from vi, by pressing Esc, then typing
:wq this will write the file to
/etc/my.cnf and quit the text editor.
Now we need to restart MySQL by using;
Tada! Now your MySQL installation is consuming almost half the amount of RAM as before, whilst still offering way more features than you are ever likely going to need for a wordpress web host.
This could probably be trimmed down even more if needed, though this will do for starters.