Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot touch `/var/log/mysqld.log': Permission denied

i have reinstalled mysql server in cent OS RHEL5.5 , Im getting the following error

touch: cannot touch `/var/log/mysqld.log': Permission denied

chown: changing ownership of `/var/log/mysqld.log': Operation not permitted

chmod: changing permissions of `/var/log/mysqld.log': Operation not permitted

MySQL Daemon failed to start.

Starting mysqld:                                           [FAILED]

I have checked the permissions for log files , its having correct permissions as mysql user

-rw-r----- 1 mysql mysql   5931 Mar  9 04:36 mysqld.log

Please let me know the issue on this and how to solve it.

Thanks

like image 231
forbidden Avatar asked Sep 14 '25 01:09

forbidden


2 Answers

Ok. I have solved the issue,

$ /usr/libexec/mysqld --skip-grant &

[1] 5388

InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes

InnoDB: than specified in the .cnf file 0 5242880 bytes! 150312 10:03:28 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.0.95' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

$ rm -rf /var/lib/mysql/ib_logfile0

$ rm -rf /var/lib/mysql/ib_logfile1

$ ls -l /var/lib/mysql

i have removed the log files and restart the mysql server.

Thanks

like image 180
forbidden Avatar answered Sep 15 '25 15:09

forbidden


The workaround is:

$ sudo touch /var/log/mysqld.log
$ sudo chown mysql:mysql /var/log/mysqld.log
$ sudo chcon system_u:object_r:mysqld_log_t:s0 /var/log/mysqld.log
like image 37
Pruthvi Avatar answered Sep 15 '25 14:09

Pruthvi