我的mysql的版本是mysql5.1.30,存储过程没有问题,主数据已经写入了数据。执行存储过程后从数据没有收到任何信息,察看/usr/local/mysql_data/localhost.localdomain.err也没有任何log。

解决方案 »

  1.   

    主从不同步?
    stop slave; 
    set global sql_slave_skip_counter =1 ;
    start slave;   
    之后Slave会和Master去同步 主要看Seconds_Behind_Master是否为0,直到为0时就已经同步了。。
      

  2.   

    不是这个问题,同步是正常的,因为同时直接写SQL语句是可以同步下去了。
      

  3.   

    直接在MYSQL中运行SP,还是用语言运行?
      

  4.   

    mysql> show slave status;
    +----------------------------------+---------------+-------------+-------------+---------------+------------------+---------------------+----------------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------------------------------------------------------------------------------+----------------+----------------+
    | 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 | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Error                                                                         | Last_SQL_Errno | Last_SQL_Error |
    +----------------------------------+---------------+-------------+-------------+---------------+------------------+---------------------+----------------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------------------------------------------------------------------------------+----------------+----------------+
    | Waiting for master to send event | 192.168.1.113 | root        |        3306 |            60 | mysql-bin.000006 |                 106 | localhost-relay-bin.000053 |           251 | mysql-bin.000006      | Yes              | Yes               | epgdb           | mysql,test          |                    |                        |                         |                             |          0 |            |            0 |                 106 |             555 | None            |                |             0 | No                 |                    |                    |                 |                   |                |                     0 | No                            |          2013 | error connecting to master '[email protected]:3306' - retry-time: 60  retries: 86400 |              0 |                | 
    +----------------------------------+---------------+-------------+-------------+---------------+------------------+---------------------+----------------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------------------------------------------------------------------------------+----------------+----------------+
    1 row in set (0.00 sec)
    不太好看,
      

  5.   

    但是我现在的问题不是主从不同步,而是存储过程执行的sql语句根本不同步,不知道是不是因为从数据没有定义这个存储过程,
      

  6.   

    存储过程,触发器 要求从方有定义.主从是基于LOG式的数据同步.已建立好的内部调用并不会自动把构造送过去.
      

  7.   

    说说你配置的过程吧。最好把你的配置文件贴出来。
    因为从SLAVE端的状态来看,上一次发生过IO错误。虽然现在正常了。
      

  8.   


    "不太好看,",用这个命令,你打的我根本看不清。show slave status \G
      

  9.   

    终于发现问题了,因为存储过程是use 其他数据来执行的,后来发现如果要某数据库同步,必要use此数据库,不能select其他数据库,用dbname.tablename来执行。谢谢大家,忘了结帖了