I am working on a Raspberry Pi running Raspbian, and I think I'm having a problem with my apt-get.

The problem originated with a MySQL server I was running. The server stopped seemingly at random, which I confirmed using sudo service mysql status. Then, I tried:

pi@Brian-RP ~ $ sudo service mysql start
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

I also tried:

pi@Brian-RP ~ $ sudo /etc/init.d/mysql start
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

as well as attempting to start my server from MySQL workbench, with no luck. So, I figured something may be wrong with my MySQL installation if the server won't even start. I tried to reinstall the following packages, starting by purging:

pi@Brian-RP ~ $ sudo apt-get purge mysql-server mysql-common mysql-client
Reading package lists... Done
pi@Brian-RP ~ $ ncy tree... 0%

The apt-get purge oddly returned in the middle of the second line. I looked for a solution to this, and it was suggested that I should apt-get update and apt-get upgrade. I ran the update successfully, but when I tried sudo apt-get upgrade, the process ended with a Segmentation fault. I'm not clear on what that means, so is there a problem with my apt? And how can I get my MySQL server running again?

EDIT: Here is my /var/log/syslog file from today:

571 Jun 28 18:43:52 Brian-RP /etc/init.d/mysql[3017]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
572 Jun 28 18:43:52 Brian-RP /etc/init.d/mysql[3017]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
573 Jun 28 18:43:52 Brian-RP /etc/init.d/mysql[3017]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
574 Jun 28 18:43:52 Brian-RP /etc/init.d/mysql[3017]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
575 Jun 28 18:43:52 Brian-RP /etc/init.d/mysql[3017]:
576 Jun 28 18:43:53 Brian-RP kernel: [   57.472792] uart-pl011 20201000.uart: no DMA platform data
577 Jun 28 18:44:45 Brian-RP wpa_supplicant[1773]: wlan0: WPA: Group rekeying completed with 38:2c:4a:69:c3:d0 [GTK=CCMP]
578 Jun 28 19:17:01 Brian-RP /USR/SBIN/CRON[3102]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
579 Jun 28 19:44:42 Brian-RP wpa_supplicant[1773]: wlan0: WPA: Group rekeying completed with 38:2c:4a:69:c3:d0 [GTK=CCMP]
  • Have you tried sudo apt-get autoclean and sudo apt-get autoremove? Also, Mysql is writing startup errors into /var/log/syslog. Would you mind posting errors from there? You could also run it manually with /usr/bin/mysqld_safe and observe the output. – Paradox Jun 28 '16 at 19:39
  • Unfortunately, both of those commands result in the same returning in the middle of the second line behavior as above. – ManOfMuffin Jun 28 '16 at 19:48
  • Here is my syslog file from today. I added it on to the question above. – ManOfMuffin Jun 28 '16 at 19:48
  • I really like aptitude, maybe check out if you can run it instead of apt-get. – PythoNic Jun 28 '16 at 19:49
  • Please run mysqld_safe --log-error=/var/log/mysql.err which will produce a log with some details at /var/log/mysql.err - please add it to your question. – Paradox Jun 29 '16 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.