Last_Error:Unabletouseslave'stemporarydirectory/var/tmp

白及88發表於2016-03-10

mysql> SHOW SLAVE STATUSG; 
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.199.151
                  Master_User: t1
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 151
               Relay_Log_File: t1-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: 
             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: 1
                   Last_Error: Unable to use slave`s temporary directory /var/tmp  | – Can`t read dir of `/var/tmp  |/` (Errcode: 2 – No such file or directory)
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 562
              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: 12
               Last_SQL_Error: Unable to use slave`s temporary directory /var/tmp | – Can`t read dir of `/var/tmp  |/` (Errcode: 2 – No such file or directory)
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 11
                  Master_UUID: 3fb17f98-e5e3-11e5-a895-000c29c89983
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: 
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 160309 19:33:03
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 1
1 row in set (0.00 sec)

ERROR: 

No query specified

環境:

centos 6.5 

mysql 5.6.10 

主 —主—-從—從—從

也適用:

主———-從

主從切換之後,出現上面問題:

解決:

vim /etc/my.cnf

basedir = /usr/local/mysql
datadir = /mydata/data
#slave_load_tmpdir = /var/tmp       #註釋
#tmpdir = /var/tmp                             #註釋

pid-file = /mydata/data/t1.pid
socket=/tmp/mysql.sock
port=3306
# read_rnd_buffer_size = 2M 

mysql出問題,找不到問題排錯建議:

先看 主機名.err ,然後再思考my.cnf配置引數,建議精通。

對應此文章答案:

http://blog.csdn.net/u010098331/article/details/50837688(問題答案)


相關文章