The Computer Oracle

How to restart MySQL?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Mysterious Puzzle

--

Chapters
00:00 How To Restart Mysql?
01:04 Answer 1 Score 5
01:28 Answer 2 Score 1
01:47 Accepted Answer Score 96
02:12 Answer 4 Score 16
02:21 Thank you

--

Full question
https://superuser.com/questions/282115/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #ubuntu #mysql

#avk47



ACCEPTED ANSWER

Score 96


You should really use the Sys-V init scripts located in /etc/init.d.

Start:

sudo /etc/init.d/mysql start

Stop:

sudo /etc/init.d/mysql stop

Restart / reload configs:

sudo /etc/init.d/mysql restart

Check run status:

sudo /etc/init.d/mysql status



ANSWER 2

Score 16


In Ubuntu machines, you can restart the mysql using both commands :

 1. sudo /etc/init.d/mysql restart

 2. # service mysql restart



ANSWER 3

Score 5


To shutdown mysql, run:

mysqladmin -uuser -ppassword shutdown

where user and password is that for a user with the proper SHUTDOWN privilege

To check that it has been shut down:

ps aux | grep mysql

If any processes (other than the 'grep' command) show up, it hasn't been shutdown.




ANSWER 4

Score 1


You can use kill -9 "PID" command to do that, the MySQL Process ID (PID) you can get running ps -a or top commands. Then you can start it again by calling ./"main process".