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

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

提交回复
热议问题