mysql5.5版本和mysql 5.6版本具體有哪些區別?


mysql5.6較5.5其中有一個很大的好處,比如給表加字段的時候,5.5或以前的版本會鎖表,5.6就不會鎖表,而且速度很快。

MySQL 5.6 對默認配置進行了一些微調,這些調整大多數都非常不錯,具體設置表現:

 

1、performance_schema 在 MySQL 5.6 中默認是開啟的,但相關的很多參數相比 MySQL 5.5 卻是降低了,例如 performance_schema 自動調整到 445 個表和 224 線程,比 MySQL 5.5 低。盡管默認 max_connections 只是 150 ,比 200 還小。
2、innodb_stats_on_metadata 在 MySQL 5.6 默認關閉,使得 information_schema 的查詢速度快很多。

3、innodb_log_file_size – 默認值從 5MB 提升到 50MB,這是一個好的改變,雖然我覺得這個默認數值還可以再大些。對於寫負載高的情況下,默認配置的 MySQL 5.6 性能更好。

4、back_log 改動比較小,從 50 改為 80。如果系統每秒處理的連接數很高,還需要繼續提高這個配置的值。

5、open_files_limit 由原來的 1024 改為 5000

6、innodb_auto_extend_increment 由 8MB 改為 64MB,可幫助降低碎片。

7、max_connect_errors 從 10 改為 100,可降低潛在的連接堵塞,但還可以更高些。

8、sort_buffer_size 從 2M 將為 256K,這可避免小排序導致的資源浪費,但是對大的排序有負面的影響。

9、max_allowed_packet 從 1MB 改為 4MB 讓 MySQL 可處理更大的查詢。

10、join_buffer_size 從 128K 改為 256K,我覺得這個改動影響不大。

11、table_open_cache 從 400 提高到 2000,挺好!

12、innodb_buffer_pool_instances 從 1 改為 8,用於優化更高並發的負載。

query_cache_type 和 query_cache_size. The behavior is “no cache” by default still but it is achieved differently now. The query_cache_type is now off by default with default size of 1MB while in MySQL 5.5 and before it was “ON” by default with query cache size of 0 which makes it disabled. I wish query_cache_size though would be larger by default as value of 1M is too small to be practical if someone tries to enable it.

sql_mode has NO_ENGINE_SUBSTITUTION value by default which is good change as trying to create Innodb table but getting MyISAM because Innodb was disabled for some reason was very error prone gotcha. Note this is as far as MySQL 5.6 goes - STRICT_MODE and other safer behaviors are not enabled by default.

13、innodb_old_blocks_time 設置為 1000,很好的改變,默認掃描 InnoDB 緩沖池大小。

14、thread_cache_size 默認啟用,對很多連接和斷開連接操作的情況下有幫助。

15、sync_relay_log_info and sync_master_info 默認值有原來的 0 改為 10000. 該改動幾乎不會影響負載。

16、secure_auth 默認開啟,要求新的密碼握手,特別是阻止老的不安全的做法,很好!

innodb_concurrency_tickets has been increased from 500 to 5000. If you’re usinginnodb_thread_concurrency this will reduce overhead associated with grabbing and releasing innodb_thread_concurrency slot but will increase potential starvation of queued threads especially for IO bound workloads. Most users will not be affected though as innodb_thread_concurrency is 0 by default so this queuing feature is disabled.

17、innodb_purge_threads 默認為 1 ,使用專用的后台 purge 線程,好!

18、innodb_open_files 由 300 改為 2000,好!

innodb_data_file_path got a small change with starting ibdata1 size raised from 10M to 12M. I’m not sure what is the purpose of this change but it is unlikely to have any practical meaning for users. Considering the default innodb_auto_extend_increment is 64 starting with 64M might have made more sense.

19、innodb_purge_patch_size 從 20 改為 300.

innodb_file_per_table 默認啟用,這個改變很大,而且很棒。特別是當你的表非常大的時候。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM