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

前端 未结 13 1653
南笙
南笙 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:19

    /usr/sbin/mysqld: File '/usr/binlogs/mysql-bin.index' not found (Errcode: 13)

    It worked for me with:

    chown -R mysql:mysql /usr/binlogs/

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

    Selinux might enforce the rule that MySQL database files have to live in /var/lib/mysql and not anywhere else. Try turning off selinux (selinux=0 on kernel boot command line) if you moved mysql to another directory.

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

    Your config is wrong:

    log_bin=/home/developer/logs/mysql/mysql-bin.log
    

    You would use instead

    log-bin=/home/developer/logs/mysql/mysql-bin.log
    
    0 讨论(0)
  • 2021-01-30 23:25

    Just as an FYI for anyone who runs into a similar problem, the solution is basically the same, but the cause of the problem isn't obvious.

    After upgrading Debian wheezy, mysql failed to start.

    Somehow, I have no idea how, permissions on some of the files in /var/lib/mysql were not owned by the mysql user, thus preventing the server from firing up.

    A chown -R mysql.mysql /var/lib/mysql fixed it.

    I didn't do anything to mess up mysql, it was a standard:

    apt-get update
    
    apt-get upgrade
    

    Something got hinky during the Debian upgrade and manual intervention was needed.

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

    mysqld: File '/data/log/mysql/mysql-bin.index' not found (Errcode: 2 - No such file or directory)

    I was really stuck in the middle of my MySQL Master - Slave setup. Finally the above was a permission issue, adding the below command solved my issue.

    chown -R mysql:mysql /data/log/mysql/

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

    Option 1:

    1. service mysqld stop

    2. Copy the log files including the .index file to new location.

       cp mysql-bin.log* /path/to/binlogs
       cp mysql-bin.index /path/to/binlogs
      
    3. Do Changes in the /etc/my.cnf file.

      [mysqld]
      log-bin=/path/to/newdirecory/mysql-bin
      
      log-bin-index=/path/to/newdirectory/mysql-bin.index
      
    4. service mysqld start

    Option 2:

    Use this utiltiy to relocate binary logs:

    mysqlbinlogmove --binlog-dir=/server/data /new/binlog_dir
    
    0 讨论(0)
提交回复
热议问题