2
I was having an issue running a mysql
command and saw suggestions on a few issues online that suggested using the service
command and it seemed to be that it was something that I should have by default.
I had been installing a few homebrew packages, so I'm not sure if that could have caused it? I have never used this command before, so I'm not entirely sure.
Attempting to run the command sudo service mysql start
returns
sudo: service: command not found
I have not got much experience using the terminal, so apologies. I saw a lot of comments suggesting that the service command is located in /usr/sbin/
and also possibly /sbin/service
but I could not find it in either.
my .bash_profile is as follows
export PATH=~/.composer/vendor/bin:$PATH
export PATH=/usr/local/php5/bin:$PATH
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:/home/user/bin
export PATH=$PATH:/sbin
The two exports at the bottom were from suggestions in other questions but neither seemed to work.
Any ideas? Any help would be greatly appreciated.
Use something like
– choroba – 2019-03-08T22:41:43.543ls /{{s,}bin,usr/{s,}bin}/service
to see whereservice
is located - but I fear macos uses a different way to handle services. See e.g. https://serverfault.com/q/194832/453007@choroba Thanks for the replay,
service
does not appear in any of the folder, running that command returnsls: /bin/service: No such file or directory ls: /sbin/service: No such file or directory ls: /usr/bin/service: No such file or directory ls: /usr/sbin/service: No such file or directory
– mcclosa – 2019-03-08T22:49:40.970On a recent system mysql is perhaps handled by
systemd
(on some systems init.d has been totally replaced bysystemd
, on older systems they still coexist). See ifsystemctl status mysql*
seems to know aboutmysql
, if somysql
is asystemd
service and can be controlled with thesystemctl
command. – xenoid – 2019-03-08T23:10:25.717What version of ubuntu are you using? – davidgo – 2019-03-09T01:22:56.303
1@davidgo None of them. The mention of Homebrew makes it clear that the OP is using macOS. – duskwuff -inactive- – 2019-03-13T22:02:34.193