我使用Ubuntu16.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发布于 2018-02-26 13:11:35
看起来,用于启动mysql的用户没有足够的权限写入文件系统。进程无法写入: /var/log/mysql/error.log
确保您有写权限
https://askubuntu.com/questions/1009954
复制相似问题