#my.cnf [client] port = 3306 socket = /home/mysql/mysql.sock # *** Application-specific options follow here *** # # The MySQL server # [mysqld] # generic configuration options user = mysql basedir = /usr datadir = /home/mysql port = 3306 socket = /home/mysql/mysql.sock # Increase the amount of open files allowed per process. Warning: Make # sure you have set the global system limit high enough! The high value # is required for a large number of opened tables open_files_limit = 8192 # back_log is the number of connections the operating system can keep in # the listen queue, before the MySQL connection manager thread has # processed them. If you have a very high connection rate and experience # "connection refused" errors, you might need to increase this value. # Check your OS documentation for the maximum value of this parameter. # Attempting to set back_log higher than your operating system limit # will have no effect. back_log = 50 # Don't listen on a TCP/IP port at all. This can be a security # enhancement, if all processes that need to connect to mysqld run # on the same host. All interaction with mysqld must be made via Unix # sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! #skip-networking # The maximum amount of concurrent sessions the MySQL server will # allow. One of these connections will be reserved for a user with # SUPER privileges to allow the administrator to login even if the # connection limit has been reached. max_connections = 100 # Maximum amount of errors allowed per host. If this limit is reached, # the host will be blocked from connecting to the MySQL server until # "FLUSH HOSTS" has been run or the server was restarted. Invalid # passwords and other errors during the connect phase result in # increasing this value. See the "Aborted_connects" status variable for # global counter. max_connect_errors = 100 # The number of open tables for all threads. Increasing this value # increases the number of file descriptors that mysqld requires. # Therefore you have to make sure to set the amount of open files # allowed to at least 4096 in the variable "open-files-limit" in # section [mysqld_safe] # 2007-09-30 change to 256 from 2048 table_cache = 256 # Enable external file level locking. Enabled file locking will have a # negative impact on performance, so only use it in case you have # multiple database instances running on the same files (note some # restrictions still apply!) or if you use other software relying on # locking MyISAM tables on file level. external-locking = FALSE # The maximum size of a query packet the server can handle as well as # maximum query size server can process (Important when working with # large BLOBs). enlarged dynamically, for each connection. max_allowed_packet = 32M # Maximum allowed size for a single HEAP (in memory) table. This option # is a protection against the accidential creation of a very large HEAP # table which could otherwise use up all memory resources. # 2007-09-30 change to 96M from 64M max_heap_table_size = 32M # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY # queries. If sorted data does not fit into the sort buffer, a disk # based merge sort is used instead - See the "Sort_merge_passes" # status variable. Allocated per thread if sort is needed. sort_buffer_size = 1M # This buffer is used for the optimization of full JOINs (JOINs without # indexes). Such JOINs are very bad for performance in most cases # anyway, but setting this variable to a large value reduces the # performance impact. See the "Select_full_join" status variable for a # count of full JOINs. Allocated per thread if full join is found join_buffer_size = 1M # How many threads we should keep in a cache for reuse. When a client # disconnects, the client's threads are put in the cache if there aren't # more than thread_cache_size threads from before. This greatly reduces # the amount of thread creations needed if you have a lot of new # connections. (Normally this doesn't give a notable performance # improvement if you have a good thread implementation.) # 2007-09-30 change to 256 from 8 thread_cache_size = 256 # This permits the application to give the threads system a hint for the # desired number of threads that should be run at the same time. This # value only makes sense on systems that support the thread_concurrency() # function call (Sun Solaris, for example). # You should try [number of CPUs]*(2..4) for thread_concurrency thread_concurrency = 8 # Query cache is used to cache SELECT results and later return them # without actual executing the same query once again. Having the query # cache enabled may result in significant speed improvements, if your # have a lot of identical queries and rarely changing tables. See the # "Qcache_lowmem_prunes" status variable to check if the current value # is high enough for your load. # Note: In case your tables change very often or if your queries are # textually different every time, the query cache may result in a # slowdown instead of a performance improvement. query_cache_size = 32M # Only cache result sets that are smaller than this limit. This is to # protect the query cache of a very large result set overwriting all # other query results. query_cache_limit = 2M # 2007-09-30 add query_cache_min_res_unit = 2k # Minimum word length to be indexed by the full text search index. # You might wish to decrease it if you need to search for shorter words. # Note that you need to rebuild your FULLTEXT index, after you have # modified this value. ft_min_word_len = 4 # If your system supports the memlock() function call, you might want to # enable this option while running MySQL to keep it locked in memory and # to avoid potential swapping out in case of high memory pressure. Good # for performance. #memlock # Table type which is used by default when creating new tables, if not # specified differently during the CREATE TABLE statement. default_table_type = MYISAM # Thread stack size to use. This amount of memory is always reserved at # connection time. MySQL itself usually needs no more than 64K of # memory, while if you use your own stack hungry UDF functions or your # OS requires more stack for some operations, you might need to set this # to a higher value. thread_stack = 192K # Set the default transaction isolation level. Levels available are: # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE # 2007-09-30 change to READ-COMMITTED from REPEATABLE-READ transaction_isolation = READ-COMMITTED # Maximum size for internal (in-memory) temporary tables. If a table # grows larger than this value, it is automatically converted to disk # based table This limitation is for a single table. There can be many # of them. # 2007-09-30 change to 96M from 64M tmp_table_size = 32M # Log slow queries. Slow queries are queries which take more than the # amount of time defined in "long_query_time" or which do not use # indexes well, if log_long_format is enabled. It is normally good idea # to have this turned on if you frequently add new queries to the # system. log_slow_queries # All queries taking more than this amount of time (in seconds) will be # trated as slow. Do not use "1" as a value here, as this will result in # even very fast queries being logged from time to time (as MySQL # currently measures time with second accuracy only). long_query_time = 1 # Log more information in the slow query log. Normally it is good to # have this turned on. This will enable logging of queries that are not # using indexes in addition to long running queries. log_long_format # The directory used by MySQL for storing temporary files. For example, # it is used to perform disk based large sorts, as well as for internal # and explicit temporary tables. It might be good to put it on a # swapfs/tmpfs filesystem, if you do not create very large temporary # files. Alternatively you can put it on dedicated disk. You can # specify multiple paths here by separating them by ";" - they will then # be used in a round-robin fashion. #tmpdir = /tmp # *** Replication related settings # Unique server identification number between 1 and 2^32-1. This value # is required for both master and slave hosts. It defaults to 1 if # "master-host" is not set, but will MySQL will not function as a master # if it is omitted. server-id = 1 # **** binlog **** #log-bin binlog_cache_size = 4M max_binlog_cache_size = 128M max_binlog_size = 1G expire_logs_days = 4 #*** MyISAM Specific options # Size of the Key Buffer, used to cache index blocks for MyISAM tables. # Do not set it larger than 30% of your available memory, as some memory # is also required by the OS to cache rows. Even if you're not using # MyISAM tables, you should still set it to 8-64M as it will also be # used for internal temporary disk tables. # 2007-09-30 change to 64M from 32M key_buffer_size = 64M # Size of the buffer used for doing full table scans of MyISAM tables. # Allocated per thread, if a full scan is needed. read_buffer_size = 1M # When reading rows in sorted order after a sort, the rows are read # through this buffer to avoid disk seeks. You can improve ORDER BY # performance a lot, if set this to a high value. # Allocated per thread, when needed. read_rnd_buffer_size = 1M # MyISAM uses special tree-like cache to make bulk inserts (that is, # INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA # INFILE) faster. This variable limits the size of the cache tree in # bytes per thread. Setting it to 0 will disable this optimisation. Do # not set it larger than "key_buffer_size" for optimal performance. # This buffer is allocated when a bulk insert is detected. bulk_insert_buffer_size = 64M # This buffer is allocated when MySQL needs to rebuild the index in # REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE # into an empty table. It is allocated per thread so be careful with # large settings. myisam_sort_buffer_size = 128M # The maximum size of the temporary file MySQL is allowed to use while # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE. # If the file-size would be bigger than this, the index will be created # through the key cache (which is slower). myisam_max_sort_file_size = 10G # If the temporary file used for fast index creation would be bigger # than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in # large tables to use the slower key cache method to create the index. myisam_max_extra_sort_file_size = 10G # If a table has more than one index, MyISAM can use more than one # thread to repair them by sorting in parallel. This makes sense if you # have multiple CPUs and plenty of memory. myisam_repair_threads = 1 # Automatically check and repair not properly closed MyISAM tables. myisam_recover # *** BDB Specific options *** # Use this option if you run a MySQL server with BDB support enabled but # you do not plan to use it. This will save memory and may speed up some # things. skip-bdb # *** INNODB Specific options *** # Use this option if you have a MySQL server with InnoDB support enabled # but you do not plan to use it. This will save memory and disk space # and speed up some things. #skip-innodb # Additional memory pool that is used by InnoDB to store metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not need to change this # value. SHOW INNODB STATUS will display the current amount used. innodb_additional_mem_pool_size = 16M # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and # row data. The bigger you set this the less disk I/O is needed to # access data in tables. On a dedicated database server you may set this # parameter up to 80% of the machine physical memory size. Do not set it # too large, though, because competition of the physical memory may # cause paging in the operating system. Note that on 32bit systems you # might be limited to 2-3.5G of user level memory per process, so do not # set it too high. innodb_buffer_pool_size = 2G # InnoDB stores data in one or more data files forming the tablespace. # If you have a single logical drive for your data, a single # autoextending file would be good enough. In other cases, a single file # per device is often a good choice. You can configure InnoDB to use raw # disk partitions as well - please refer to the manual for more info # about this. innodb_data_file_path = ibdata1:1024M:autoextend # Set this option if you would like the InnoDB tablespace files to be # stored in another location. By default this is the MySQL datadir. #innodb_data_home_dir = # Number of IO threads to use for async IO operations. This value is # hardcoded to 4 on Unix, but on Windows disk I/O may benefit from a # larger number. innodb_file_io_threads = 4 # If you run into InnoDB tablespace corruption, setting this to a nonzero # value will likely help you to dump your tables. Start from value 1 and # increase it until you're able to dump the table successfully. #innodb_force_recovery=1 # Number of threads allowed inside the InnoDB kernel. The optimal value # depends highly on the application, hardware as well as the OS # scheduler properties. A too high value may lead to thread thrashing. innodb_thread_concurrency = 4 # If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small # transactions, you may set this to 0 or 2 to reduce disk I/O to the # logs. Value 0 means that the log is only written to the log file and # the log file flushed to disk approximately once per second. Value 2 # means the log is written to the log file at each commit, but the log # file is only flushed to disk approximately once per second. innodb_flush_log_at_trx_commit = 1 # Speed up InnoDB shutdown. This will disable InnoDB to do a full purge # and insert buffer merge on shutdown. It may increase shutdown time a # lot, but InnoDB will have to do it on the next startup instead. #innodb_fast_shutdown # The size of the buffer InnoDB uses for buffering log data. As soon as # it is full, InnoDB will have to flush it to disk. As it is flushed # once per second anyway, it does not make sense to have it very large # (even with long transactions). # 2007-09-12 modify to 16M from 8M innodb_log_buffer_size = 16M # Size of each log file in a log group. You should set the combined size # of log files to about 25%-100% of your buffer pool size to avoid # unneeded buffer pool flush activity on log file overwrite. However, # note that a larger logfile size will increase the time needed for the # recovery process. # 2007-09-12 modify to 400M from 256M innodb_log_file_size = 400M # Total number of files in the log group. A value of 2-3 is usually good # enough. innodb_log_files_in_group = 3 # Location of the InnoDB log files. Default is the MySQL datadir. You # may wish to point it to a dedicated hard drive or a RAID1 volume for # improved performance #innodb_log_group_home_dir # Maximum allowed percentage of dirty pages in the InnoDB buffer pool. # If it is reached, InnoDB will start flushing them out agressively to # not run out of clean pages at all. This is a soft limit, not # guaranteed to be held. innodb_max_dirty_pages_pct = 90 # The flush method InnoDB will use for Log. The tablespace always uses # doublewrite flush logic. The default value is "fdatasync", another # option is "O_DSYNC". #innodb_flush_method=O_DSYNC # How long an InnoDB transaction should wait for a lock to be granted # before being rolled back. InnoDB automatically detects transaction # deadlocks in its own lock table and rolls back the transaction. If you # use the LOCK TABLES command, or other transaction-safe storage engines # than InnoDB in the same transaction, then a deadlock may arise which # InnoDB cannot notice. In cases like this the timeout is useful to # resolve the situation. innodb_lock_wait_timeout = 120 # for tlbb 2007-03-23 innodb_file_per_table # for tlbb 2007-10-24 #innodb_rollback_on_timeout [mysqldump] # Do not buffer the whole result set in memory before writing it to # file. Required for dumping very large tables quick # for tlbb 2007-03-23 max_allowed_packet = 32M [mysql] no-auto-rehash # Only allow UPDATEs and DELETEs that use keys. #safe-updates [isamchk] key_buffer = 512M sort_buffer_size = 512M read_buffer = 8M write_buffer = 8M [myisamchk] key_buffer = 512M sort_buffer_size = 512M read_buffer = 8M write_buffer = 8M [mysqlhotcopy] interactive-timeout show global status: mysql> show global status; +-----------------------------------+------------+ | Variable_name | Value | +-----------------------------------+------------+ | Aborted_clients | 74 | | Aborted_connects | 5 | | Binlog_cache_disk_use | 0 | | Binlog_cache_use | 0 | | Bytes_received | 4261512963 | | Bytes_sent | 4284769552 | | Com_admin_commands | 1807 | | Com_alter_db | 0 | | Com_alter_table | 0 | | Com_analyze | 0 | | Com_backup_table | 0 | | Com_begin | 22943194 | | Com_change_db | 1 | | Com_change_master | 0 | | Com_check | 0 | | Com_checksum | 0 | | Com_commit | 22943193 | | Com_create_db | 0 | | Com_create_function | 0 | | Com_create_index | 0 | | Com_create_table | 3 | | Com_dealloc_sql | 0 | | Com_delete | 1885566 | | Com_delete_multi | 0 | | Com_do | 0 | | Com_drop_db | 0 | | Com_drop_function | 0 | | Com_drop_index | 0 | | Com_drop_table | 6 | | Com_drop_user | 0 | | Com_execute_sql | 0 | | Com_flush | 0 | | Com_grant | 0 | | Com_ha_close | 0 | | Com_ha_open | 0 | | Com_ha_read | 0 | | Com_help | 0 | | Com_insert | 27056040 | | Com_insert_select | 10 | | Com_kill | 0 | | Com_load | 0 | | Com_load_master_data | 0 | | Com_load_master_table | 0 | | Com_lock_tables | 0 | | Com_optimize | 0 | | Com_preload_keys | 0 | | Com_prepare_sql | 0 | | Com_purge | 0 | | Com_purge_before_date | 0 | | Com_rename_table | 0 | | Com_repair | 0 | | Com_replace | 0 | | Com_replace_select | 0 | | Com_reset | 0 | | Com_restore_table | 0 | | Com_revoke | 0 | | Com_revoke_all | 0 | | Com_rollback | 0 | | Com_savepoint | 0 | | Com_select | 46574129 | | Com_set_option | 31 | | Com_show_binlog_events | 0 | | Com_show_binlogs | 0 | | Com_show_charsets | 0 | | Com_show_collations | 0 | | Com_show_column_types | 0 | | Com_show_create_db | 0 | | Com_show_create_table | 22 | | Com_show_databases | 0 | | Com_show_errors | 0 | | Com_show_fields | 22 | | Com_show_grants | 0 | | Com_show_innodb_status | 537 | | Com_show_keys | 0 | | Com_show_logs | 0 | | Com_show_master_status | 0 | | Com_show_ndb_status | 0 | | Com_show_new_master | 0 | | Com_show_open_tables | 0 | | Com_show_privileges | 0 | | Com_show_processlist | 1338 | | Com_show_slave_hosts | 0 | | Com_show_slave_status | 0 | | Com_show_status | 280 | | Com_show_storage_engines | 0 | | Com_show_tables | 1 | | Com_show_triggers | 22 | | Com_show_variables | 416 | | Com_show_warnings | 0 | | Com_slave_start | 0 | | Com_slave_stop | 0 | | Com_stmt_close | 0 | | Com_stmt_execute | 0 | | Com_stmt_fetch | 0 | | Com_stmt_prepare | 0 | | Com_stmt_reset | 0 | | Com_stmt_send_long_data | 0 | | Com_truncate | 4 | | Com_unlock_tables | 1 | | Com_update | 49498252 | | Com_update_multi | 4 | | Com_xa_commit | 0 | | Com_xa_end | 0 | | Com_xa_prepare | 0 | | Com_xa_recover | 0 | | Com_xa_rollback | 0 | | Com_xa_start | 0 | | Compression | OFF | | Connections | 4332 | | Created_tmp_disk_tables | 44 | | Created_tmp_files | 10 | | Created_tmp_tables | 769 | | Delayed_errors | 0 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Flush_commands | 1 | | Handler_commit | 101356381 | | Handler_delete | 0 | | Handler_discover | 0 | | Handler_prepare | 0 | | Handler_read_first | 983 | | Handler_read_key | 176528333 | | Handler_read_next | 89122416 | | Handler_read_prev | 148 | | Handler_read_rnd | 2387376 | | Handler_read_rnd_next | 29236162 | | Handler_rollback | 7 | | Handler_savepoint | 0 | | Handler_savepoint_rollback | 0 | | Handler_update | 7638 | | Handler_write | 27403924 | | Innodb_buffer_pool_pages_data | 119978 | | Innodb_buffer_pool_pages_dirty | 52104 | | Innodb_buffer_pool_pages_flushed | 4584994 | | Innodb_buffer_pool_pages_free | 0 | | Innodb_buffer_pool_pages_latched | 4 | | Innodb_buffer_pool_pages_misc | 11094 | | Innodb_buffer_pool_pages_total | 131072 | | Innodb_buffer_pool_read_ahead_rnd | 63726 | | Innodb_buffer_pool_read_ahead_seq | 37390 | | Innodb_buffer_pool_read_requests | 2552967032 | | Innodb_buffer_pool_reads | 5447730 | | Innodb_buffer_pool_wait_free | 0 | | Innodb_buffer_pool_write_requests | 636163075 | | Innodb_data_fsyncs | 52880528 | | Innodb_data_pending_fsyncs | 0 | | Innodb_data_pending_reads | 1 | | Innodb_data_pending_writes | 0 | | Innodb_data_read | 1557860352 | | Innodb_data_reads | 6519724 | | Innodb_data_writes | 56125425 | | Innodb_data_written | 4054581248 | | Innodb_dblwr_pages_written | 4584994 | | Innodb_dblwr_writes | 55876 | | Innodb_log_waits | 0 | | Innodb_log_write_requests | 60904243 | | Innodb_log_writes | 52657601 | | Innodb_os_log_fsyncs | 52667986 | | Innodb_os_log_pending_fsyncs | 0 | | Innodb_os_log_pending_writes | 0 | | Innodb_os_log_written | 4136708096 | | Innodb_page_size | 16384 | | Innodb_pages_created | 218356 | | Innodb_pages_read | 8953286 | | Innodb_pages_written | 4584994 | | Innodb_row_lock_current_waits | 0 | | Innodb_row_lock_time | 97162 | | Innodb_row_lock_time_avg | 303 | | Innodb_row_lock_time_max | 12107 | | Innodb_row_lock_waits | 320 | | Innodb_rows_deleted | 27011718 | | Innodb_rows_inserted | 27056637 | | Innodb_rows_read | 170157076 | | Innodb_rows_updated | 46391062 | | Key_blocks_not_flushed | 0 | | Key_blocks_unused | 57985 | | Key_blocks_used | 5 | | Key_read_requests | 2016001 | | Key_reads | 5 | | Key_write_requests | 0 | | Key_writes | 0 | | Last_query_cost | 0.000000 | | Max_used_connections | 46 | | Not_flushed_delayed_rows | 0 | | Open_files | 31 | | Open_streams | 0 | | Open_tables | 65 | | Opened_tables | 78 | | Qcache_free_blocks | 1 | | Qcache_free_memory | 33545600 | | Qcache_hits | 313 | | Qcache_inserts | 775718 | | Qcache_lowmem_prunes | 0 | | Qcache_not_cached | 45798534 | | Qcache_queries_in_cache | 0 | | Qcache_total_blocks | 1 | | Questions | 331553173 | | Rpl_status | NULL | | Select_full_join | 4 | | Select_full_range_join | 0 | | Select_range | 0 | | Select_range_check | 0 | | Select_scan | 1240 | | Slave_open_temp_tables | 0 | | Slave_retried_transactions | 0 | | Slave_running | OFF | | Slow_launch_threads | 0 | | Slow_queries | 99 | | Sort_merge_passes | 10 | | Sort_range | 0 | | Sort_rows | 341 | | Sort_scan | 7 | | Ssl_accept_renegotiates | 0 | | Ssl_accepts | 0 | | Ssl_callback_cache_hits | 0 | | Ssl_cipher | | | Ssl_cipher_list | | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_ctx_verify_depth | 0 | | Ssl_ctx_verify_mode | 0 | | Ssl_default_timeout | 0 | | Ssl_finished_accepts | 0 | | Ssl_finished_connects | 0 | | Ssl_session_cache_hits | 0 | | Ssl_session_cache_misses | 0 | | Ssl_session_cache_mode | NONE | | Ssl_session_cache_overflows | 0 | | Ssl_session_cache_size | 0 | | Ssl_session_cache_timeouts | 0 | | Ssl_sessions_reused | 0 | | Ssl_used_session_cache_entries | 0 | | Ssl_verify_depth | 0 | | Ssl_verify_mode | 0 | | Ssl_version | | | Table_locks_immediate | 102498520 | | Table_locks_waited | 0 | | Tc_log_max_pages_used | 0 | | Tc_log_page_size | 0 | | Tc_log_page_waits | 0 | | Threads_cached | 37 | | Threads_connected | 9 | | Threads_created | 46 | | Threads_running | 1 | | Uptime | 80884 | +-----------------------------------+------------+ show tables: mysql> show tables; +------------------+ | Tables_in_tlbbdb | +------------------+ | t_ability | | t_char | | t_charextra | | t_city | | t_crc32 | | t_cshop | | t_cshopitem | | t_global | | t_guild | | t_impact | | t_iteminfo | | t_itemkey | | t_mail | | t_mission | | t_pet | | t_petcreate | | t_pshop | | t_relation | | t_skill | | t_var | | t_xfallexp | | t_xinfa | +------------------+