mariadb服务器:我无法通过`mysql.server stop`停止服务器 [英] mariadb server: I can't stop the server with `mysql.server stop`
问题描述
OSX 10.13.6
OSX 10.13.6
几年前,我用自制软件安装了mariadb服务器,并且很少使用.今天,我尝试使用以下命令启动mariadb:
I installed mariadb sever with homebrew a few years ago, and I use it infrequently. Today, I tried to start mariadb using the command:
$ mysql.server start
,我遇到了很多错误.所以,我做到了:
and I got a bunch of errors. So, I did:
$ brew update
然后:
$ brew uprade mariadb
那很好,现在我可以用以下命令启动mariadb了:
That completed fine, and now I can start mariadb with:
$ mysql.server start
,我可以访问我所有的旧数据库.
and I can access all my old db's.
我遇到的问题是我无法停止mysql.这两个命令都将挂起:
The problem I'm having is that I cannot stop mysql. Both these commands hang:
$ mysql.server stop
和(在另一个终端窗口中):
and(in another terminal window):
$ mysql.server status
根据 mysql.server 的MariaDB文档,这两个命令都应工作.
According to the MariaDB docs for mysql.server, both those commands should work.
当前,我正在像这样杀死服务器:
Currently, I'm killing the server like this:
$ killall mysqld mysqld_safe
然后检查服务器是否被杀死:
then checking that the server was killed with this:
$ ps aux | grep mysqld
当我在mysql运行时运行ps命令时,我得到:
When I run the ps command when mysql is running, I get:
〜$ ps aux | grep mysqld
7stud 3707 0.0 1.0 4808208 79948 s005 S 1:26 PM 0:00.47
/usr/local/地窖/mariadb/10.3.15/bin/mysqld --basedir =/usr/local/Cellar/mariadb/10.3.15 --datadir =/usr/local/var/mysql --plugin-dir =/usr/local/Cellar/mariadb/10.3.15/lib/plugin --log-error =/usr/local/var/mysql/My-MacBook-Pro-2.local.err --pid-file =/usr/local/var/mysql/My-MacBook-Pro-2.local .pid
~$ ps aux | grep mysqld
7stud 3707 0.0 1.0 4808208 79948 s005 S 1:26PM 0:00.47
/usr/local/Cellar/mariadb/10.3.15/bin/mysqld --basedir=/usr/local/Cellar/mariadb/10.3.15 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mariadb/10.3.15/lib/plugin --log-error=/usr/local/var/mysql/My-MacBook-Pro-2.local.err --pid-file=/usr/local/var/mysql/My-MacBook-Pro-2.local.pid
7stud 3643 0.0 0.0 4287792 1460 s005 S 1:26 PM 0:00.02/bin/sh /usr/local/地窖/mariadb/10.3.15/bin/mysqld_safe --datadir =/usr/local/var/mysql --pid-file =/usr/local/var/mysql/My-MacBook-Pro-2.local.pid
7stud 3643 0.0 0.0 4287792 1460 s005 S 1:26PM 0:00.02 /bin/sh /usr/local/Cellar/mariadb/10.3.15/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/My-MacBook-Pro-2.local.pid
第7梭鱼4544 0.0 0.0 0.0 4267752 880 s000 S + 1:41 PM 0:00.00
grep mysqld
7stud 4544 0.0 0.0 4267752 880 s000 S+ 1:41PM 0:00.00
grep mysqld
关闭mariadb服务器的正确方法是什么?
What is the proper way to shut down the mariadb server?
mysql> SHOW VARIABLES LIKE '%vers%';
+---------------------------------+------------------------------------------+
| Variable_name | Value |
+---------------------------------+------------------------------------------+
| innodb_version | 10.3.15 |
| protocol_version | 10 |
| slave_type_conversions | |
| system_versioning_alter_history | ERROR |
| system_versioning_asof | DEFAULT |
| thread_pool_oversubscribe | 3 |
| version | 10.3.15-MariaDB |
| version_comment | Homebrew |
| version_compile_machine | x86_64 |
| version_compile_os | osx10.13 |
| version_malloc_library | system |
| version_source_revision | 07aef9f7eb936de2b277f8ae209a1fd72510c011 |
| version_ssl_library | OpenSSL 1.0.2r 26 Feb 2019 |
| wsrep_patch_version | wsrep_25.24 |
+---------------------------------+------------------------------------------+
14 rows in set (0.01 sec)
推荐答案
请参见 https://stackoverflow.com/a/59938033/4579271 以获取详细信息.
See https://stackoverflow.com/a/59938033/4579271 for details.
要修复,请运行:
cp /usr/local/bin/mysql.server /usr/local/bin/mysql.server.backup
sed -i "" "s/user='mysql'/user=\`whoami\`/g" /usr/local/bin/mysql.server
这篇关于mariadb服务器:我无法通过`mysql.server stop`停止服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!