rpl_rotate_logs.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:4k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. drop table if exists t1, t2, t3, t4;
  2. drop table if exists t1, t2, t3, t4;
  3. start slave;
  4. ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
  5. start slave;
  6. ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
  7. change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
  8. ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
  9. reset slave;
  10. change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
  11. reset master;
  12. start slave;
  13. create temporary table temp_table (a char(80) not null);
  14. insert into temp_table values ("testing temporary tables");
  15. create table t1 (s text);
  16. insert into t1 values('Could not break slave'),('Tried hard');
  17. show slave status;
  18. Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
  19. # 127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 None 0 No #
  20. select * from t1;
  21. s
  22. Could not break slave
  23. Tried hard
  24. flush logs;
  25. create table t2(m int not null auto_increment primary key);
  26. insert into t2 values (34),(67),(123);
  27. flush logs;
  28. show binary logs;
  29. Log_name File_size
  30. master-bin.000001 461
  31. master-bin.000002 213
  32. master-bin.000003 4
  33. create table t3 select * from temp_table;
  34. select * from t3;
  35. a
  36. testing temporary tables
  37. drop table temp_table, t3;
  38. insert into t2 values(1234);
  39. set insert_id=1234;
  40. insert into t2 values(NULL);
  41. set global sql_slave_skip_counter=1;
  42. start slave;
  43. purge master logs to 'master-bin.000002';
  44. show master logs;
  45. Log_name File_size
  46. master-bin.000002 213
  47. master-bin.000003 229
  48. purge binary logs to 'master-bin.000002';
  49. show binary logs;
  50. Log_name File_size
  51. master-bin.000002 213
  52. master-bin.000003 229
  53. purge master logs before now();
  54. show binary logs;
  55. Log_name File_size
  56. master-bin.000003 229
  57. insert into t2 values (65);
  58. show slave status;
  59. Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
  60. # 127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 None 0 No #
  61. select * from t2;
  62. m
  63. 34
  64. 65
  65. 67
  66. 123
  67. 1234
  68. create temporary table temp_table (a char(80) not null);
  69. insert into temp_table values ("testing temporary tables part 2");
  70. create table t3 (n int);
  71. select count(*) from t3 where n >= 4;
  72. count(*)
  73. 100
  74. create table t4 select * from temp_table;
  75. show binary logs;
  76. Log_name File_size
  77. master-bin.000003 4167
  78. master-bin.000004 2886
  79. show master status;
  80. File Position Binlog_Do_DB Binlog_Ignore_DB
  81. master-bin.000004 2886
  82. select * from t4;
  83. a
  84. testing temporary tables part 2
  85. show slave status;
  86. Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
  87. # 127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 None 0 No #
  88. lock tables t3 read;
  89. select count(*) from t3 where n >= 4;
  90. count(*)
  91. 100
  92. unlock tables;
  93. drop table if exists t1,t2,t3,t4;