try to change bin log directory: mysql-bin.index not found (Errcode: 13)

前端 未结 13 1716
南笙
南笙 2021-01-30 22:53

MySQL 5.1.54 Ubuntu 11.04

I\'am try to change bin log directory in my.conf as:

[mysqld]
log_bin=/home/developer/logs/mysql/mysql-bin.log
<
相关标签:
13条回答
  • 2021-01-30 23:04

    Does your user have access to all upper directories? In special, the /home/developer/ directory? Try to log in with the mysql server account and touch the log file.

    0 讨论(0)
  • 2021-01-30 23:04

    I had a similar problem when I was trying to change the datadir variable during a fresh install. The solution in my case was to run the first time start up with log-bin disabled. After that I was able to enable it again using the new path ...

    0 讨论(0)
  • 2021-01-30 23:06

    You need to give user permissions to the directory as follows:

    chown -R mysql:mysql /home/developer/logs/mysql/
    
    0 讨论(0)
  • 2021-01-30 23:10

    As usual, the solution was simple but not obvious: it needed to edit apparmor settings I just added to /etc/apparmor.d/usr.sbin.mysqld a new string with path to target directory: /home/developer/logs/* rw

    It works!

    0 讨论(0)
  • 2021-01-30 23:12

    You can also comment the line in my.cnf file which is defining the log location, so mysql will consider its default path and will start properly.

    log-bin = /var/log/mysql/mysql-bin.log -> #log-bin = /var/log/mysql/mysql-bin.log.

    This will be helpful if you are not concerned much about logs.

    0 讨论(0)
  • 2021-01-30 23:17

    As documentation in mysql say https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_bin

    The variable is log_bin and not log-bin at least in version 5.7

    0 讨论(0)
提交回复
热议问题