我正在尝试在Red Hat 7上启动mysql.

我按照以下说明删除了maria db并安装了mysql:

> 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处于许可模式.

解决方法:

这可能是由于redhat bug#1189131所致,先前的mariadb安装在后面留下了兼容性软链接:

尝试删除/var/log/mysqld.log并重新启动MySQL.

标签:linux,mysql

来源: https://codeday.me/bug/20191028/1951707.html

Logo

更多推荐