mysql数据库做了主、从,当我用insert into my_table values(...)这种命令在主数据库的表中插入数据时,可以同步过去,但是当我用insert into my_table select * from you_table where...这种命令在主数据库的表中插入数据时,却不能同步,是什么原因?
解决方案 »
- 讨论帖:关于mysql的shared-compat和devel-community主页上版本是否标注的有问题?
- 两个表都有id字段用left join连接后怎么分别获取
- 一个数据库有大约 1w个表,会不会影响数据库查询的效率,数据几乎是不改变的!!
- 散分 mysql数据库的极限
- mysql 主从备份指定表
- 请教FOUND_ROWS()新特性
- 请问:shuixin13(犬犬(心帆)) 我要访问局域网内另一台机器的Mysql怎么配置呢。
- help!!!!!!!!!sql的多表问题............100分!!!!!!!!!
- mysql 的问题?
- 求助。有没有人用过heidisql的 像这个统计信息想给他清空掉要怎么清
- access某字段数据内容导入到mysql某字段?
- 有没有按快捷键就能运行mysql语句的mysql管理软件?
master,slave:show variables like '%format%';把上面2个命令的结果贴出来看看。
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.220
Master_User: rep1
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000074
Read_Master_Log_Pos: 66655
Relay_Log_File: mysqld-relay-bin.000227
Relay_Log_Pos: 11559
Relay_Master_Log_File: mysql-bin.000074
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: egreen_data_zhuanli_new
Replicate_Ignore_DB: mysql
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 66655
Relay_Log_Space: 11715
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)+---------------------+-------------------+
| Variable_name | Value |
+---------------------+-------------------+
| binlog_format | STATEMENT |
| date_format | %Y-%m-%d |
| datetime_format | %Y-%m-%d %H:%i:%s |
| default_week_format | 0 |
| time_format | %H:%i:%s |
+---------------------+-------------------+上面为从,下面为主
+--------------------------+-------------------+
| Variable_name | Value |
+--------------------------+-------------------+
| binlog_format | STATEMENT |
| date_format | %Y-%m-%d |
| datetime_format | %Y-%m-%d %H:%i:%s |
| default_week_format | 0 |
| innodb_file_format | Antelope |
| innodb_file_format_check | ON |
| innodb_file_format_max | Antelope |
| time_format | %H:%i:%s |
+--------------------------+-------------------+
insert into my_table select * from you_table where... 造成的?
再insert into my_table select * from you_table where...
我的意思是,为什么用insert into my_table select * from you_table where...这种方法插入的数据不能同步过去?而insert into ... values...插入的数据可以正常同步?