the answer is there MySQL can not write to the directory you are pointing inside my.cnf
, and it dose not have the right permissions. to fix this problem make sure the user MySQL has owner privileges on the directory that my.cnf
is pointing for example lets say the base_dir
is located under /MySQL
, data_dir
is located under /MySQL/data
and the socket is located under /tmp
in this example you need to make sure /MySQL
and /MySQL/data
are owned by MySQL user, for /tmp
since its a default directory for Linux user MySQL should have read,write and execute privileges. also you need to make sure the partition that contain the data_dir
is not full "contain enough free space"
There are five(5) methods you can do
METHOD #1
Don't run restart. Delete the binlogs between shutdown and startup.
Let's say mysql-bin.*
is in /var/lib/mysql
. Run the following:
cd /var/lib/mysql
service mysql stop
rm -f mysql-bin.*
service mysql start
After startup, login to mysql and run
SHOW MASTER STATUS;
an you should see mysql-bin.000001
METHOD #2
Create a script to execute RESET MASTER;
and have it executed
Step 01 : Add this line to my.cnf
under the [mysqld]
group header
[mysqld]
init-file=/var/lib/mysql/init.sql
Step 02 : Run the following
echo "RESET MASTER;" > /var/lib/mysql/init.sql
chown mysql:mysql /var/lib/mysql/init.sql
Step 03 : service mysql restart
METHOD #3
Do it by hand. Login to mysql and run
mysql> RESET MASTER;
METHOD #4
Erase binary logs immediately after restart
MYSQL_USER=root
MYSQL_PASS=rootpassword
MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}"
service mysql restart
mysql ${MYSQL_CONN} -e"RESET MASTER"
METHOD #5 (Permanent)
Step 01 : Go to my.cnf
and comment out the log-bin
option
[mysqld]
#log-bin=mysql-bin
or delete the line that says log-bin=mysql-bin
Step 02 : Run the following
cd /var/lib/mysql
service mysql stop
rm -f mysql-bin.*
service mysql start
Step 03 : Login to mysql and run
mysql> SHOW BINARY LOGS;
The output should be
ERROR 1381 (HY000): You are not using binary logging
GIVE IT A TRY !!!
Best Answer
The answer maybe in the question. "Can't find file: './mysql/plugin.frm'"
You may test the SELinux theory by running the following:
To permanently turn off SELinux, follow the steps here.