Below is an example configuration file to tune MySQL a bit which you can use as a starting point. This will tell MySQL to use a lot more RAM than the default configuration but allows to keep a lot of the data in memory, which makes it much faster. On Debian/Ubuntu, I usually place this in /etc/mysql/conf.d/tuning.conf. On other systems, you can append it to the my.conf.
# Amount of simultaneous connections
# Total query cache size
# Size limit for a single query to be cached
# Number of tables kept in cache
# Number of table defiinitions in cache
# Size of temporary tables kept in memory
# Max size of HEAP tables kept in memory
# Size of key/index caches
# Size of Join caches
# Log slow queries
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 5
# Size of InnoDB buffer. If you have a dedicated DB server with a lot of
# memory, you can make this as big as you can.. preferable big enough to fit your complete data.
# If you do not need full ACID compliance, this can be set 0. It means that you will loose data for
# the last 1-2 seconds but makes the system much faster.
# Log file size. Careful when changing this, stop mysql first.
# Various performance settings. See documentation for more information.
# Skips the slow DNS resolves.
Important: When changing innodb_log_time_size, see http://www.mysqlperformanceblog.com/2011/07/09/how-to-change-innodb_log_file_size-safely
Note that this is just an example. You will need to fine-tune the exact settings based on the amount of data and amount of spare memory you have. A very helpful tool for this is https://github.com/rackerhacker/MySQLTuner-perl. Add the above example script, let your server run for a few days and then run the script which will tell you how much of the assigned resources are in use and will also give you a few tips on how to improve it.