Can't start mysql on Linux - Can't access / var / log / mysqld.log:

I am trying to start mysql on Red Hat 7. I uninstalled maria db and installed mysql following instructions:

http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html#yum-repo-setup

    > service mysql start
Redirecting to /bin/systemctl start  mysql.service
screen hangs here...

^C


[root@abc mysql]# service mysql status
Redirecting to /bin/systemctl status  mysql.service
mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
   Active: activating (start-post) (Result: exit-code) since Tue 2015-05-12 16:26:38 EDT; 1min 5s ago
  Process: 7365 ExecStart=/usr/bin/mysqld_safe (code=exited, status=1/FAILURE)
  Process: 7354 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 7365 (code=exited, status=1/FAILURE);         : 7366 (mysql-systemd-s)
   CGroup: /system.slice/mysqld.service
           └─control
             ├─7366 /bin/bash /usr/bin/mysql-systemd-start post
             └─7730 sleep 1

May 12 16:26:38 abc mysqld_safe[7365]: chmod: cannot access ‘/var/log/mysqld.log’: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: 150512 16:26:38 mysqld_safe Starting mysqld daemon with databases fr...mysql
May 12 16:26:38 abc mysqld_safe[7365]: /usr/bin/mysqld_safe: line 129: /var/log/mysqld.log: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: /usr/bin/mysqld_safe: line 166: /var/log/mysqld.log: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: touch: cannot touch ‘/var/log/mysqld.log’: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: chown: cannot access ‘/var/log/mysqld.log’: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: chmod: cannot access ‘/var/log/mysqld.log’: Permission denied
May 12 16:26:38 abc mysqld_safe[7365]: 150512 16:26:38 mysqld_safe mysqld from pid file /var/run/mysqld/mys...ended
May 12 16:26:38 abc mysqld_safe[7365]: /usr/bin/mysqld_safe: line 129: /var/log/mysqld.log: Permission denied
May 12 16:26:38 abc systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Hint: Some lines were ellipsized, use -l to show in full.

      

OK let's take a look at / var / log / mysql

[root@abc ~]# ll /var/log | grep mysql  
-rw-r-----. 1 mysql  mysql        0 May 12 16:01 mysqld.log

      

I am checking on another system, the permissions are the same as above. OK I will try to fix the file ...

[root@abc ~]# chmod 777 /var/log/mysqld.log

      

Now restart.

[root@abc ~]# service mysql start

      

same errors as above and I am losing my chmod ...

ll / var / log | grep mysql -rw -p -----. 1 mysql mysql 0 May 12 16:01 mysqld.log

Selinux is in permissive mode.

+3


source to share


1 answer


This could be due to redhat bug # 1189131 where a previous installation of mariadb left the programmatic compatibility link behind:



Try deleting /var/log/mysqld.log and restarting MySQL.

+4


source







All Articles