我一直在尝试在Linux Antergos上安装Apache和MySQL。不幸的是,在安装MySQL(pacman -S mysql
)之后,无法启动该服务。我想知道出了什么问题。 pacman
error: 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
。
<tr>
<td class='links'>
<a href='/user/update/id/<?php echo $this->id;?>'>Update</a>
<a href='/user/delete/id/<?php echo $this->id;?>'>Delete</a>
</td>
<td><?php echo $this->lastname ?></td>
<td><?php echo $this->firstname ?></td>
<td><?php echo $this->username ?></td>
<td><?php echo $this->role ?></td>
在任何帮助下都会非常感谢,提前谢谢。
答案 0 :(得分:0)
您发布的错误不是太具描述性,但至少我们可以看到可能存在权限错误。
检查/var/lib/mysql
对于mysql用户是否为rwx,并且对于mysql用户和/或组,其中的文件至少都是rw-。
您可以使用ls -l /var/lib/mysql/
进行检查
您可以通过发出
sudo chown mysql:mysql -R /var/lib/mysql
*首先检查用户/组是否为mysql,否则将失败
看看守护进程是否记录了systemctl日志(如果它正在这样做,最有可能你会在你的mysql目录中找到一个mysql.err,但如果权限错误,它可能无法登录所有那里)