How to start/stop MySQL server on Linux How to start / stop servidor MySQL no Linux
# To Start MySQL Server # Para iniciar o servidor MySQL
/sbin/service mysqld start / sbin / mysqld iniciar serviço
# To Stop MySQL Server # Para interromper o servidor MySQL
/sbin/service mysqld stop / sbin / mysqld parar de serviço
# To Restart MySQL Server # Para reiniciar o MySQL Server
/sbin/service mysqld restart / sbin / mysqld serviço reiniciar
And of course there is the brute force way to kill all the processes: E, claro, há a força bruta maneira de matar todos os processos:
$ for i in `ps -ef |grep mysqld |awk ‘{print $2}’`; do `kill -9 $i`; done $ For i em `ps-ef | grep mysqld | awk '(print $ 2)'`; fazer `kill -9 $ i`; feito
Thanks to Anthony Eden for the comment (below) to remove the dot in front. Graças a Anthony Eden para o comentário (abaixo) para remover o ponto em frente.
A simpler alternative is: Uma alternativa é simples:
pkill mysqld pkill mysqld
This will kill the mysqld process. Isso irá matar o processo mysqld. However the best way to stop (because it stops properly) is obviously: No entanto, a melhor maneira de parar (porque ela pára corretamente) é obviamente:
/sbin/service mysqld stop / sbin / mysqld parar de serviço
Filed under Arquivado em Database Banco de dados , Linux , RDBMS , Web Hosting Web Hosting | |
| |
RSS 2.0 RSS 2,0 | |
Email this Article E-mail este artigo
You may also like to read Você pode também gosta de ler |




January 8th, 2005 at 12:21 pm 8 de janeiro de 2005, às 12:21 pm
I suggest you remove the . Sugiro-lhe que retire o. in front of the first slash so that you can execute that command from anywhere, not just in the / directory. em frente à primeira barra de modo que você possa executar o comando a partir de qualquer lugar, e não apenas no diretório /.
February 2nd, 2005 at 4:41 am 2 de fevereiro de 2005, às 4:41 am
what about sobre aquilo
# killall mysqld # Killall mysqld
February 2nd, 2005 at 5:20 am 2 de fevereiro de 2005, às 5:20 am
Ortwin,
Very true. Muito verdade. killall can be used instead of the awkward awk code. killall pode ser usado em vez do código awk embaraçosa. I missed it because it is not on my Linux installation provided by my hosting provider. Eu perdi-lo porque não é a minha instalação Linux fornecidas pelo meu provedor de hospedagem.
Thanks for the tip. Agradecimentos para a ponta.
Angsuman
March 20th, 2005 at 8:31 pm 20 de março de 2005, às 8:31 pm
very good muito bom
March 31st, 2007 at 5:49 am 31 de março de 2007 em 5:49 am
hai angsuman ..well the tip you provided to start the SQL server isnt working . hai angsuman .. bem a dica que você forneceu para iniciar o servidor SQL isn't trabalho.
April 2nd, 2007 at 7:48 am 2 de abril de 2007 em 7:48 am
You can also try these: Você também pode tentar estes:
service mysqld start Serviço de iniciar o mysqld
service mysqld stop serviço mysqld parar
service mysqld restart Serviço de reiniciar o mysqld
October 18th, 2007 at 5:06 am Outubro 18o, 2007 em 5:06 am
I tried the above one, but not able to stop! Eu tentei o que precede um, mas não conseguem parar!
October 18th, 2007 at 1:14 pm Outubro 18o, 2007 em 1:14 pm
To stop just use: Para parar de usar apenas:
service mysqld stop serviço mysqld parar
November 27th, 2007 at 3:19 pm 27 de novembro de 2007 em 3:19 pm
I tried /sbin/service mysqld stop Eu tentei / sbin / mysqld parar de serviço
But faled. Mas faled. got response “mysqld: unrecognized service obtive resposta "mysqld: despercebidas serviço
“ "
November 27th, 2007 at 3:26 pm 27 de novembro de 2007 em 3:26 pm
Got the way. Got a caminho. “service mysql stop” worked fine. "Serviço mysql stop" trabalhou bem.
But, please clarify the difference. Mas, por favor, esclarecer a diferença. I don’t know what is the difference. Não sei qual é a diferença.
November 27th, 2007 at 8:22 pm 27 de novembro de 2007 em 8:22 pm
No difference. Nenhuma diferença. The name of the mysqld executive may vary from one distribution to another and even between versions. O nome do mysqld executivos podem variar de uma para outra distribuição e mesmo entre versões. On fedora core 6 it is mysqld. On Fedora Core 6, é o mysqld. Which distro are you using? Distro que você está usando?
November 29th, 2007 at 7:48 pm 29 de novembro de 2007 em 7:48 pm
Worked like a charm, many thanks! Trabalhou como um encanto, muito obrigado!
June 11th, 2008 at 5:20 am 11 de junho, 2008, 5:20 am
Really this should be titled How to Stop Mysql Server on Redhat/Fedora. Na realidade, isto deveria ser intitulado How to Stop servidor MySQL com Redhat / Fedora. /sbin/service is a redhat-ism. / sbin / serviço é um redhat-ism. Its basically a wrapper script around the init.d scripts. Sua basicamente um invólucro ao redor do script init.d scripts. Debian/Ubuntu users, and other based on SysV style init scripts (most I think maybe not SuSE) can do the same thing by invoking /etc/init.d/mysql stop as root which is what /sbin/service does. Debian / Ubuntu usuários, e outros baseados em SysV estilo scripts init (mais SuSE penso que talvez não) pode fazer a mesma coisa, invocando / etc / init.d / mysql stop como raiz que é o / sbin / serviço faz.