安装 git 后 MySQL 无法运行

安装 git 后 MySQL 无法运行

我使用 Ubuntu 16.04,在服务器上安装之前一切都很好git。现在 MySQL 显然已停止并且无法启动。


结果如下mysql -V

mysql  Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using  EditLine wrapper

结果如下sudo /etc/init.d/mysql start

[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
failed!

这是结果mysql -u root -p<myPassword>

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

知道如何修复该问题吗?


编辑:命令的结果如下systemctl status mysql.service

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Mon 2018-02-26 14:07:46 CET; 6s ago
  Process: 9641 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 9634 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 9641 (code=exited, status=1/FAILURE);         : 9642 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           └─control
             ├─9642 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─9656 sleep 1

Feb 26 14:07:46 lamtakam.com systemd[1]: Starting MySQL Community Server...
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.416882Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.417028Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.639899Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.643617Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.20-0ubuntu0.16.04.1) starting as process 9641 ...
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.646599Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Permission denied
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.647922Z 0 [ERROR] Aborting
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.648209Z 0 [Note] Binlog end
Feb 26 14:07:46 lamtakam.com mysqld[9641]: 2018-02-26T13:07:46.648540Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Feb 26 14:07:46 lamtakam.com systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

答案1

看起来您用来启动 mysql 的用户没有足够的权限写入文件系统。进程无法写入:/var/log/mysql/error.log

确保您具有写权限

相关内容