0

I have upgraded my PHP from version 5.6 to 7.2 and now MySQL does not work. When I enter sudo service mysqsl start, the following text gets displayed:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

output of journalctl -xe

output of systemctl status mysql.service:

mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: exit-code) since \u0633\u0647\u200c\u0634\u0646\u0628\u0647 2018-07-17 04:22:01 +0430; 27s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 26938 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 6860 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
 Main PID: 9974 (code=exited, status=0/SUCCESS)

\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: [97B blob data]
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: Fatal error in defaults handling. Program aborted
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: [61B blob data]
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: ...fail!
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Control process exited, code=exited status=1
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Unit entered failed state.
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Failed with result 'exit-code'.

How can I fix this problem? I need to start MySQL.

Sina Qahremani
  • 134
  • 1
  • 9
  • Have you changed / updated anything else? By itself mysql does not depend on php as far as I know although there might be shared libraries. – jeroen Jul 17 '18 at 12:48
  • @jeroen no I didn't. please check output of journalctl -xe – Sina Qahremani Jul 17 '18 at 12:49
  • Don't you simply miss _php7.0-mysql_ ? try `sudo apt list --installed | grep mysql` to figure out – St3an Jul 17 '18 at 12:49
  • That's why I asked, there is no mention of php in the output of `journalctl -xe` either... – jeroen Jul 17 '18 at 12:50
  • @cantStopChangingMyName I installed it after install php7 – Sina Qahremani Jul 17 '18 at 12:56
  • @jeroen I think some files are missed – Sina Qahremani Jul 17 '18 at 12:56
  • Did you reboot after install? In extremely rare cases would be needed. – spectatorx Jul 17 '18 at 12:57
  • @spectatorx No I didn't. Now I can't reboot, because I don't have physical access to server and I use vncserver to remote. – Sina Qahremani Jul 17 '18 at 13:03
  • Backup databases and perform clean install of whole LAMP stack with php 7.2. – spectatorx Jul 17 '18 at 13:05
  • @spectatorx Should I uninstall all packages of LAMP? – Sina Qahremani Jul 17 '18 at 13:09
  • Before reinstalling, I'd definitely try this thread : https://stackoverflow.com/questions/11990708/error-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysq – St3an Jul 17 '18 at 13:13
  • In theory you shouldn't as upgrade should went fine but since you have some problems after upgrade then i would give it a try. Since you got an error on attempt to restart mysql service check service's status, if it is ok you can continue. If you get an error with specific error message try to solve it. Backup databases first! Next remove LAMP packages with --purge parameter (sudo apt-get remove --purge) and after removing LAMP install it fresh. – spectatorx Jul 17 '18 at 13:13

0 Answers0