Binary log error in mysql

后端 未结 8 1625
后悔当初
后悔当初 2021-01-03 00:41

When I am trying to check binary log:

 SHOW BINARY LOGS;

I get this error:

ERROR 1381 (HY000): You are not using bin

8条回答
  •  半阙折子戏
    2021-01-03 01:28

    I've found logging will silently fail to happen even if my.cnf config is right, so you can also try re-creating your log folder.

    This may be necwssary if the logs are in an odd state. (In my case, I had simply ceased logging in my.cnf and then re-enabled it, but nothing happened, probably because the existing files were not the latest updates?).

    Something like this should work:

    sudo service mysql stop
    sudo mv /var/log/mysql /tmp/mysqlold # or rm -fr if you're brave
    mkdir /var/log/mysql
    chown -R mysql:mysql /var/log/mysql
    sudo service mysql start
    

    Obligatory warning: Obviously, take care when deleting anything on a database server. This will destroy/disrupt/corrupt any replication using this database as master (though you can resume replication as a slave). That said, I believe this should be safe insofar as it doesn't delete the database itself.

提交回复
热议问题