从master的phpmyadmin

时间:2017-11-17 06:30:18

标签: mysql phpmyadmin database-replication master-slave

我已使用此https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

从现有主SQL服务器成功配置了MYSQL slave

设置工作正常,通过MySQL shell对master进行的更改完美地反映在slave上。但是如果我从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_table_uiprefs'不存在'

请指导。

2 个答案:

答案 0 :(得分:0)

问题是系统正在尝试复制副本中不存在的phpadmin表。要使其工作,您需要排除phpmyadmin db。

在slave mysqld.cnf文件中,您需要添加:

replicate-ignore-db=phpmyadmin

并重新启动副本

答案 1 :(得分:0)

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

  1. 通过以下指南http://usefulangle.com/post/35/how-to-install-linux-apache-mysql-php-phpmyadmin-lamp-stack-on-ubuntu-16-04
  2. 在slave上安装MySQL和PHPMyAdmin
  3. 将PHPMyAdmin表从主数据库导入到从数据库。问题是由于主和从phpmyadmin表中的表名不匹配而发生的。
  4. 我还没理解为什么奴隶正在复制PHPMyAdmin表,尽管在主配置中设置了binlog_ignore_db = phpmyadmin