似乎在 Ubuntu 14.04 机器上,用户mysql
无法访问任何东西。它不是写日志也不是读文件。见证:
- bruno():mysql$ cat /etc/passwd | grep mysql
mysql:x:116:127:MySQL Server,,,:/nonexistent:/bin/false
- bruno():mysql$ sudo mysql_install_db
Installing MySQL system tables...
140818 18:16:50 [ERROR] Can't read from messagefile '/usr/share/mysql/english/errmsg.sys'
140818 18:16:50 [ERROR] Aborting
140818 18:16:50 [Note]
Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.
...boilerplate trimmed...
- bruno():mysql$ ls -la /usr/share/mysql/english/errmsg.sys
-rw-r--r-- 1 root root 59535 Jul 29 13:40 /usr/share/mysql/english/errmsg.sys
- bruno():mysql$ wc -l /usr/share/mysql/english/errmsg.sys
16 /usr/share/mysql/english/errmsg.sys
在这里我们看到即使打开了权限也mysql
无法读取,实际上普通登录用户可以读取文件(带)。此外,MySQL 没有写入任何日志:/usr/share/mysql/english/errmsg.sys
wc
- bruno():mysql$ ls -la /var/log/mysql
total 8
drwxr-s--- 2 mysql adm 4096 Aug 18 16:10 .
drwxrwxr-x 18 root syslog 4096 Aug 18 16:10 ..
什么可能导致该用户无法访问任何内容?我能做些什么呢?
请尝试像上面一样运行,并确保 mysql 对每个文件夹都有正确的权限。她的参考https://dev.mysql.com/doc/refman/5.7/en/mysql-install-db.html和https://dev.mysql.com/doc/refman/5.7/en/error-message -language.html