0

我一直在尝试在 Linux Antergos 上安装 Apache 和 MySQL。不幸的是,安装 MySQL ( pacman -S mysql) 后,无法启动该服务。我想知道出了什么问题。如前所述,移除包裹的努力是徒劳pacmanerror: target not found: mysql

Start mysql (sudo systemctl start mysqld) returns:
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.


sudo systemctl status mysqld.service
mysqld.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: activating (start-post) (Result: exit-code) since Tue 2015-08-04 17:16:21 CEST; 18s ago
  Process: 6496 ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
 Main PID: 6496 (code=exited, status=1/FAILURE);         : 6497 (mysqld-post)
   CGroup: /system.slice/mysqld.service
           └─control
             ├─6497 /bin/sh /usr/bin/mysqld-post
             └─6639 sleep 1

Aug 04 17:16:21 zsworkstation systemd[1]: Starting MariaDB database server...
Aug 04 17:16:21 zsworkstation mysqld[6496]: 150804 17:16:21 [Note] /usr/bin/mysqld (mysqld 10.0.20-MariaDB-log) starting as process 6496 ...
Aug 04 17:16:21 zsworkstation mysqld[6496]: 150804 17:16:21 [Warning] Can't create test file /var/lib/mysql/zsworkstation.lower-test
Aug 04 17:16:21 zsworkstation mysqld[6496]: [96B blob data]
Aug 04 17:16:21 zsworkstation mysqld[6496]: 150804 17:16:21 [ERROR] Aborting
Aug 04 17:16:21 zsworkstation mysqld[6496]: 150804 17:16:21 [Note] /usr/bin/mysqld: Shutdown complete
Aug 04 17:16:21 zsworkstation systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE

非常感谢任何帮助,在此先感谢。

4

1 回答 1

0

您发布的错误描述性不太强,但至少我们可以看到可能存在权限错误。检查/var/lib/mysqlmysql 用户是否为 rwx,并且里面的文件对于 mysql 用户和/或组至少都是 rw-。

您可以检查它,ls -l /var/lib/mysql/ 您可以通过发出来更改文件所有权

sudo chown mysql:mysql -R /var/lib/mysql

*首先检查用户/组是否被称为mysql,否则会失败

看看守护进程是否在 systemctl 日志之外进行记录(如果这样做,您很可能会在您的 mysql 目录中找到一个 mysql.err,但如果权限错误,它可能根本无法在那里记录)

于 2015-08-04T16:11:40.717 回答