I use Ubuntu 16.04 and everything was fine until I installed git
on the server. Now apparently MySQL is stopped and it doesn't start.
Here is the result of mysql -V
:
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper
And here is the result of 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!
An here is the result of 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)
Any idea how can I fix the problem?
EDIT: Here is the result of systemctl status mysql.service
command:
● 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
It looks like the user which you used to start mysql does not have enough permission to write to file systems. Porcess was unable to write to : /var/log/mysql/error.log
Ensure that you have write permission