[MySQL] File './mysql-bin.index' not found (Errcode: 13)

Tadashi Shigeoka ·  Wed, November 2, 2011

I’ll introduce the solution for when an error occurs after installing MySQL from source code, initializing it, and trying to start it.

MySQL

Prerequisites - MySQL Installation

By the way, here are the steps for installing MySQL from source code:

Error: Starting MySQL.The server quit without updating PID file

 

An error occurred when starting MySQL.

# service mysql start
Starting MySQL.The server quit without updating PID file (/[FAILED]cal/mysql/data/bms.pid).

Error Cause Investigation

To see the error details more clearly, here are the results of running with a direct path specification:

# /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
/usr/local/mysql/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
111102 16:31:21 [ERROR] Aborting

111102 16:31:21 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

It appears that the mysql-bin.index file doesn’t exist, and indeed it wasn’t there.

The cause was that all directory permissions under /usr/local/mysql were set to root.

Error Resolution

Before running MySQL initialization with mysql_install_db, you need to change the directory permissions from root to mysql using chown.

Change the directory permissions to the mysql user:

chown -R mysql:mysql /usr/local/mysql/

Then initialize MySQL and you should be good to go:

/usr/local/mysql/scripts/mysql_install_db \\
    --user=mysql \\
    --basedir=/usr/local/mysql \\
    --datadir=/usr/local/mysql/data

That’s all on resolving the “File ’./mysql-bin.index’ not found (Errcode: 13)” error from the Gemba.

Reference Information

That’s all from the Gemba.