代码之家  ›  专栏  ›  技术社区  ›  jugadengg

当从主机的phpmyadmin发出命令时,Mysql主从复制中断

  •  0
  • jugadengg  · 技术社区  · 7 年前

    我已经使用这个从现有的主SQL server成功配置了MYSQL slave https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

    安装工作正常,通过MySQL shell对master所做的更改完美地反映在从机上。但是如果我从PHPMyAdmin发出命令,系统就会崩溃。它显示以下错误

    mysql> show slave status \G
    *************************** 1. row ***************************
                   Slave_IO_State: Waiting for master to send event
                      Master_Host: ***.***.***.***
                      Master_User: *****
                      Master_Port: 3306
                    Connect_Retry: 60
                  Master_Log_File: mysql-bin.0000**
              Read_Master_Log_Pos: 107
                   Relay_Log_File: mysql-relay-bin.00000*
                    Relay_Log_Pos: 2407
            Relay_Master_Log_File: mysql-bin.000**
                 Slave_IO_Running: Yes
                Slave_SQL_Running: No
                  Replicate_Do_DB: 
              Replicate_Ignore_DB: 
               Replicate_Do_Table: 
           Replicate_Ignore_Table: 
          Replicate_Wild_Do_Table: 
      Replicate_Wild_Ignore_Table: 
                       Last_Errno: 1146
                       Last_Error: Error 'Table 'phpmyadmin.pma_table_uiprefs' doesn't exist' on query. Default database: ''. Query: 'REPLACE INTO `phpmyadmin`.`pma_table_uiprefs` VALUES ('**', '******', '******', '{"sorted_col":"`******`.`date` DESC","CREATE_TIME":"2016-12-19 09:35:35","col_order":["1","2","3","4","5","0","6","7","8","9"]}', NULL)'
                     Skip_Counter: 0
              Exec_Master_Log_Pos: 2261
                  Relay_Log_Space: 8323
                  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: NULL
    Master_SSL_Verify_Server_Cert: No
                    Last_IO_Errno: 0
                    Last_IO_Error: 
                   Last_SQL_Errno: 1146
                   Last_SQL_Error: Error 'Table 'phpmyadmin.pma_table_uiprefs' doesn't exist' on query. Default database: ''. Query: 'REPLACE INTO `phpmyadmin`.`pma_table_uiprefs` VALUES ('******', '******', '******', '{"sorted_col":"`******`.`date` DESC","******":"2016-12-19 09:35:35","col_order":["1","2","3","4","5","0","6","7","8","9"]}', NULL)'
      Replicate_Ignore_Server_Ids: 
                 Master_Server_Id: 1
    1 row in set (0.00 sec)
    

    Phpmyadmin没有在从机上配置(我安装它时没有将其配置为从机参数),在主配置中,我通过以下命令显式地将Phpmyadmin设置为不在从机上复制。

    binlog_ignore_db    = phpmyadmin
    

    如何删除此错误

    “phpmyadmin。pma\u table\u uiprefs“不存在”

    请引导。

    2 回复  |  直到 7 年前
        1
  •  0
  •   nacho    7 年前

    问题是,它试图复制复制副本中不存在的phpadmin表的系统。为了使其工作,您需要排除phpmyadmin数据库。

    在从mysqld中。cnf文件,您需要添加以下内容:

    replicate-ignore-db=phpmyadmin
    

    并重新启动复制副本

        2
  •  0
  •   jugadengg    7 年前

    所以我通过以下步骤解决了这个问题

    1. 通过以下指南在从属服务器上安装MySQL和PHPMyAdmin http://usefulangle.com/post/35/how-to-install-linux-apache-mysql-php-phpmyadmin-lamp-stack-on-ubuntu-16-04
    2. 将PHPMyAdmin表从主数据库导入从数据库。出现这些问题的原因是主phpmyadmin表和从phpmyadmin表中的表名不匹配。

    我不明白的是,为什么slave会在设置的情况下复制PHPMyAdmin表 binlog_ignore_db = phpmyadmin 在主配置中。

    推荐文章