我正在尝试在Red Hat 7上启动mysql。 我删除了maria db并按照以下说明安装了mysql:
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.
好的,让我们来看看/ var / log / mysql
[root@abc ~]# ll /var/log | grep mysql
-rw-r-----. 1 mysql mysql 0 May 12 16:01 mysqld.log
我检查另一个系统,权限与上面相同。 好的我会尝试修复文件......
[root@abc ~]# chmod 777 /var/log/mysqld.log
现在重启..
[root@abc ~]# service mysql start
与上述相同的错误,我失去了我的chmod ......
ll / var / log | grep mysql -rw-R -----。 1 mysql mysql 0 5月12日16:01 mysqld.log
Selinux处于宽松模式。
答案 0 :(得分:4)
这可能是由于redhat bug#1189131,其中之前的mariadb安装后面留下了兼容性软链接:
尝试删除/var/log/mysqld.log并重启MySQL。