Replication of tables
Full replication: CREATE TABLE New_service select * from service;
Partial copy: Create TABLE User (host char, user char (+)) Select Host,user from mysql.user where restriction condition;
or create table t3 (x char, y char) select name as x, user as y from TableName;
P.S. If CREATE table t3 (x char, y char) select name, user from TableName;
———— establishes name,user two columns after x, y two empty columns
To copy only the table header:
CREATE TABLE User (host char), user char (+)) Select Host,user from Mysql.user where arbitrary false condition
P.s. This method does not copy key
CREATE table new_user like user; This method key also replicates
Replication of records
INSERT INTO TableName (col1,col2,col3. COLN)
Select (Col1,col2,col3...coln) from tablename2 where condition;
Replication of MySQL tables and replication of data