1

Because this did not work for me: MySQL 5.7 in Raspberry Pi 2

I installed MySQL from source, and now I have MySQL 5.7.11 installed under /usr/local/mysql.

I've never used systemd, so I don't know exactly how it works. Many tutorials say use 'something like this'. Right now I would just like to start mysql, but that's failing.

pi@raspberry3:~/bin $ sudo systemctl stop mysql
pi@raspberry3:~/bin $ sudo systemctl status mysql
● mysql.server.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysql.server)
   Active: inactive (dead) since Tue 2016-03-29 15:33:17 UTC; 5s ago
  Process: 21277 ExecStop=/etc/init.d/mysql.server stop (code=exited, status=0/SUCCESS)
  Process: 20735 ExecStart=/etc/init.d/mysql.server start (code=exited, status=0/SUCCESS)

Mar 29 06:29:40 raspberry3 mysql.server[20735]: Starting MySQL
Mar 29 06:29:40 raspberry3 mysql.server[20735]: Couldn't find MySQL server (/usr/bin/mysqld_safe) ... failed!
Mar 29 06:29:40 raspberry3 systemd[1]: Started LSB: start and stop MySQL.
Mar 29 15:33:17 raspberry3 systemd[1]: Stopping LSB: start and stop MySQL...
Mar 29 15:33:17 raspberry3 mysql.server[21277]: MySQL server PID file could not be found! ... failed!
Mar 29 15:33:17 raspberry3 systemd[1]: Stopped LSB: start and stop MySQL.

$ sudo systemctl start mysql
pi@raspberry3:~/bin $ sudo systemctl status mysql
● mysql.server.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysql.server)
   Active: active (exited) since Tue 2016-03-29 15:33:53 UTC; 1s ago
  Process: 21277 ExecStop=/etc/init.d/mysql.server stop (code=exited, status=0/SUCCESS)
  Process: 21328 ExecStart=/etc/init.d/mysql.server start (code=exited, status=0/SUCCESS)

Mar 29 15:33:53 raspberry3 mysql.server[21328]: Starting MySQL
Mar 29 15:33:53 raspberry3 mysql.server[21328]: Couldn't find MySQL server (/usr/bin/mysqld_safe) ... failed!
Mar 29 15:33:53 raspberry3 systemd[1]: Started LSB: start and stop MySQL.

mysqld_safe exists at /usr/local/mysql/bin/mysqld_safe, so I've tried to copy it to the path /usr/bin/mysqld_safe, but that fails terribly.

Do I just need to adjust some path in some file so it may find mysqld_safe and it will start?

Thanks for any help getting MySQL running on the Raspberry!

/etc/init.d/mysql.server: http://pastiebin.com/56fb184058ae8

1 Answer 1

1

The problem is that /etc/init.d/mysql.server is looking for MySQL in the wrong place. You are correct that copying the binary will cause problems.

One way to fix it would be to edit this file, and change occurrences of /usr/ to /usr/local/. This is what I recommend.

Another would be to uninstall MySQL completely from /usr/local and install it in /usr instead (./configure --prefix=/usr). If you use this route, make sure you uninstall it completely, removing every file it installed.

3
  • 1
    Hi Will. Thanks for the pointer. What file do you recommend I change, exactly? Commented Mar 29, 2016 at 22:19
  • Open up /etc/init.d/mysql.server in your text editor and look for /usr/ and replace it with /usr/local/. It might help if you post the contents of this file in your question and then I could tell you more specifically.
    – Will
    Commented Mar 29, 2016 at 23:34
  • HI Will, full file posted to pastiebin. See new edit in OP. Commented Mar 30, 2016 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.