本篇內容介紹了“MySQL相關技術舉例分析”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
我們提供的服務有:網站建設、成都網站制作、微信公眾號開發(fā)、網站優(yōu)化、網站認證、拉薩ssl等。為近1000家企事業(yè)單位解決了網站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的拉薩網站制作公司
1.復制過濾問題:
--replicate-do-db=db_name:
USE prices;
UPDATE sales.january SET amount=amount+1000;
Statement-based replication:對于基于語句級的復制(或mixed級別),replicate_do_db這個參數(shù)指的是默認的數(shù)據(jù)庫,即當前使用的數(shù)據(jù)庫(use database),在默認數(shù)據(jù)庫下更新replicate_do_db指定的數(shù)據(jù)庫,從庫不會隨之更新,會有問題
解決:對于binlog_format=statement或mixed,只在從庫設置replicate_wild_do_table= sales.%或replicate_wild_ignore_table即可。此時可以避免跨庫更新問題。
對于binlog_format=statement或mixed,只在從庫設置replicate_wild_do_table= quyou.%或replicate_wild_ignore_table即可。此時可以避免跨庫更新問題。
對于binlog_format=statement或mixed,只在從庫設置replicate_wild_do_table= quyou.%或replicate_wild_ignore_table即可。此時可以避免跨庫更新問題。
Row-based replication:不存在問題
2.InnoDB單列索引長度不能超過767bytes限制問題
實際上聯(lián)合索引還有一個限制是3072:
By default, the index key prefix length limit is 767 byte
When the innodb_large_prefix configuration option is enabled, the index key prefix length limit is raised to 3072 bytes for InnoDB tables that use DYNAMIC or COMPRESSED row format.
The limits that apply to index key prefixes also apply to full-column index keys.
If you reduce the InnoDB page size to 8KB or 4KB by specifying the innodb_page_size option when creating the MySQL instance, the maximum length of the index key is lowered proportionally, based on the limit of 3072 bytes for a 16KB page size. That is, the maximum index key length is 1536 bytes when the page size is 8KB, and 768 bytes when the page size is 4KB.
解決:
MySQL 5.5.14及其后版本解決了最大767字節(jié)索引長度的問題,引入了innodb_large_prefix配置關鍵字。這項關鍵字必須配合innodb_file_format和innodb_file_per_table
innodb_large_prefix = True
innodb_file_format = Barracuda
innodb_file_per_table = True
Barracuda 在原來的基礎上(Antelope)新增了Dynamic和Compressed兩種行格式。
“Mysql相關技術舉例分析”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關的知識可以關注創(chuàng)新互聯(lián)網站,小編將為大家輸出更多高質量的實用文章!
文章題目:Mysql相關技術舉例分析
本文地址:http://chinadenli.net/article34/ppehse.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供移動網站建設、電子商務、全網營銷推廣、自適應網站、網站維護、微信小程序
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)