MySQL chain table usage

Source: Internet
Author: User

MySQL chain tables may be unfamiliar to many new users who are new to MySQL databases. MySQL chain tables are only supported by MySQL 5.0.3 or above, and there are still some restrictions.

The remote server can only be MySQL and does not support distributed transactions.
Use show create table or show table status to view the link string.

Specific Method:

Add a federated row under [mysqld] In My. ini, and restart the mysql service to enable the chain table engine.

Create a table:

 
 
  1. CREATE TABLE federated_table (  
  2.     id     int(20) NOT NULL auto_increment,  
  3.     name   varchar(32) NOT NULL default '',  
  4.     other int(20) NOT NULL default '0',  
  5.     PRIMARY KEY (id),  
  6.     KEY name (name),  
  7.     KEY other_key (other)  
  8. )  
  9. ENGINE=FEDERATED 
  10. DEFAULT CHARSET=utf-8  
  11. CONNECTION='mysql://root@remote_host:9306/federated/test_table';  
  12.  

Connection can be in the following formats:

 
 
  1. CONNECTION='mysql://username:password@hostname:port/database/tablename' 
  2. CONNECTION='mysql://username@hostname/database/tablename' 
  3. CONNECTION='mysql://username:password@hostname/database/tablename' 
  4.    

Combination of multiple MySQL table result sets

Implementation of MySQL table sharding

MySQL authorization table usage example

Disadvantages of MySQL memory tables

Deletes the MySQL registry information.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.