MySQL configuration that I am using for developing Drupal in localhost. The config file can be found from /etc/mysql/my.cnf under Linux. I would use it for any apache instance tough. You might get errors if you are not using ArchLinux, but this is simple to tweak to work on any distribution.
Source code viewer
# This is for a MySQL like InnoDB system with 8G of RAM. # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option. # The following options will be passed to all MariaDB clients [client] #password = your_password port = 3306 socket = /run/mysqld/mysqld.sock # Here follows entries for some specific programs # The database server [mysqld] port = 3306 socket = /run/mysqld/mysqld.sock skip-external-locking key_buffer_size = 32M max_allowed_packet = 16M table_open_cache = 16384 table_definition_cache = 4096 table_cache = 4096 optimizer_search_depth = 4 sort_buffer_size = 2M join_buffer_size = 2M net_buffer_length = 8K read_buffer_size = 2M read_rnd_buffer_size = 64M myisam_sort_buffer_size = 8M #collation-server = utf8_general_ci # Point the following paths to different dedicated disks #tmpdir = /tmp/ interactive_timeout = 400 connect_timeout = 10 tmp_table_size = 64M max_heap_table_size = 64M query_cache_type = 2 query_cache_size = 64M query_cache_limit = 16M max_connections = 64 open_files_limit = 65535 # Replication Master Server (default) # binary logging is required for replication # binary logging format - mixed recommended binlog_format=mixed # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1 # Force recover databases. #innodb_force_recovery = 6 # InnoDB tables innodb_data_home_dir = /var/lib/mysql innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /var/lib/mysql # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high # Use mysqltuner to calculate maximum possible memory usage and adjust accordingly. innodb_buffer_pool_size = 1G innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size innodb_log_file_size = 256M innodb_log_buffer_size = 12M innodb_flush_log_at_trx_commit = 2 innodb_lock_wait_timeout = 180 innodb_log_files_in_group = 2 innodb_support_xa = 0 innodb_thread_concurrency = 8 innodb_doublewrite = 0 innodb_file_per_table = 1 innodb_file_format = barracuda innodb_strict_mode = 1 innodb_fast_shutdown = 0 innodb_flush_method=O_DIRECT bind-address = 127.0.0.1 skip-name-resolve max_user_connections = 150 key_buffer = 16M key_cache_block_size = 4K bulk_insert_buffer_size = 256M myisam_sort_buffer_size = 64M back_log = 2048 open-files = 10000 query_prealloc_size = 65536 query_alloc_block_size = 131072 binlog_cache_size = 1M thread_cache_size = 100 thread_concurrency = 4 thread_stack = 192K [mysqldump] quote-names max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeoutProgramming Language: MySQL