¿Cómo se detiene MySQL en una instalación de Mac OS?
He instalado MySQL a través de MacPorts. ¿Cuál es el comando que necesito para detener el servidor (necesito probar cómo se comporta mi aplicación cuando MySQL está muerto)?
18 answers
Hay diferentes casos dependiendo de si ha instalado MySQL con el instalador binario oficial, usando MacPorts , o usando Homebrew :
MacPorts
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql.plist
Nota: esto es persistente después del reinicio.
Homebrew
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Instalador binario
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-12-03 11:44:47
Para aquellos que usaron homebrew para instalar MySQL, use los siguientes comandos a continuación para iniciar, detener o reiniciar MySQL
Brew start
/usr/local/bin/mysql.server start
Brew restart
/usr/local/bin/mysql.server restart
Brew stop
/usr/local/bin/mysql.server stop
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-04-23 22:26:04
Siempre puede usar el comando "mysqladmin shutdown"
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-09-19 10:24:49
Si está usando homebrew
puede usar
brew services restart mysql
brew services start mysql
brew services stop mysql
Para una lista de servicios disponibles
brew services list
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-05-13 13:43:54
Sudo /usr/local/mysql/support-files/mysql.parada del servidor
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-05 19:58:54
sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop
También puede usar start y restart aquí. Encontré esto mirando el contenido de /Library/LaunchDaemons/org.macports.mysql.plist.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-01-12 21:48:41
Aparentemente quieres:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
Tener una lectura adicional en Por Dios, Dejen De Preocuparse Por La Instalación De RMagic.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-21 08:35:02
Intenta
sudo <path to mysql>/support-files/mysql.server start
sudo <path to mysql>/support-files/mysql.server stop
Otro intento:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop<br>
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
Sin embargo, encontré que la segunda opción solo funcionaba (OS X 10.6, MySQL 5.1.50) si el .plist ha sido cargado con:
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
PD: También encontré que necesitaba descargar el .plist para obtener una instalación no relacionada de MAMP-MySQL para iniciar / detener correctamente. Después de ejecutar esto, MAMP-MySQL comienza bien:
Sudo launchctl unload-w /Library/LaunchDaemons/com.mysql.mysqld.plist
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-21 22:17:39
En mi mac osx yosemite 10.10. Este comando funcionó:
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist
Puede encontrar su archivo mysql en la carpeta /Library/LaunchDaemons/ para ejecutar
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-22 03:38:02
Uso:
sudo mysqladmin shutdown --user=*user* --password=*password*
Probablemente uno podría salirse con la suya sin usar sudo. El usuario podría ser root por ejemplo (es decir, el usuario root de MySQL).
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-09-03 19:40:16
Bueno, si todo lo demás falla, podría simplemente tomar el enfoque despiadado y matar el proceso que ejecuta MySQL manualmente.
Es decir,
ps -Af
Para listar todos los procesos, entonces haga "kill <pid>
" donde <pid>
es el id del proceso del demonio MySQL (mysqld).
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-21 20:48:42
Última OSX (10.8) y mysql 5.6, el archivo está bajo Demonios de lanzamiento y es com.oráculo.OSS.mysql.mysqld.plist. Presenta una opción bajo Opciones del sistema, generalmente al final de la lista. Así que vaya a configuración del sistema, haga clic en Mysql y apáguelo desde el cuadro de opciones. https://dev.mysql.com/doc/refman/5.6/en/osx-installation-launchd.html
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-23 14:13:11
Para mí es trabajar con un"mysql5"
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-06-30 10:09:05
En OSX Snow Leopard
launchctl unload /System/Library/LaunchDaemons/org.mysql.mysqld.plist
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-15 09:15:08
Instalé mysql5 y mysql55 sobre macports. Para mí, los archivos mencionados aquí se encuentran en los siguientes lugares:
(mysql55-server) / opt/local/etc/LaunchDaemons / org.macports.mysql55-server / org.macports.mysql55-server.plist
(mysql5) / opt/local/etc/LaunchDaemons / org.macports.mysql5 / org.macports.mysql5.plist
Así que deteniéndose para estas obras como esta:
Mysql55-server:
sudo launchctl unload -w /opt/local/etc/LaunchDaemons/org.macports.mysql55-server/org.macports.mysql55-server.plist
Mysql5:
sudo launchctl unload -w /opt/local/etc/LaunchDaemons/org.macports.mysql5/org.macports.mysql5.plist
Puede comprobar si el servicio sigue corriendo con:
ps ax | grep mysql
Además, puede consultar los archivos de registro en mi caso aquí:
Mysql55-server
sudo tail -n 100 /opt/local/var/db/mysql55/<MyName>-MacBook-Pro.local.err
...
130213 08:56:41 mysqld_safe mysqld from pid file /opt/local/var/db/mysql55/<MyName>-MacBook-Pro.local.pid ended
Mysql5:
sudo tail -n 100 /opt/local/var/db/mysql5/<MyName>-MacBook-Pro.local.err
...
130213 09:23:57 mysqld ended
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-02-13 08:38:29
Si ha instalado el paquete MySQL 5 con MacPorts:
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
O
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5-devel.plist
Si ha instalado el paquete mysql5-devel
.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-21 08:35:45
Mysql > mostrar variables donde variable_name como ' % dir%';
| datadir / / opt / local / var / db / mysql5 / /
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-03 21:31:25
Después de probar todos esos línea de comandos, y no es trabajo.Tengo que hacer las siguientes cosas:
mv /usr/local/Cellar/mysql/5.7.16/bin/mysqld /usr/local/Cellar/mysql/5.7.16/bin/mysqld.bak
mysql.server stop
De esta manera funciona, el proceso mysqld se ha ido. pero el /var/log/system.registro tiene un montón de basura:
Jul 9 14:10:54 xxx com.apple.xpc.launchd[1] (homebrew.mxcl.mysql[78049]): Service exited with abnormal code: 1
Jul 9 14:10:54 xxx com.apple.xpc.launchd[1] (homebrew.mxcl.mysql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-09 06:12:56