如何停止MacOs创建/删除mysql示例?

ef1yzkbh  于 2023-02-28  发布在  Mysql
关注(0)|答案(1)|浏览(178)

我使用的是MacOS Ventura 13.0和Apple M1 Max芯片,我想(并尝试)使用MySQL Workbench。也许这个问题与bug "Crash after a select" at mysql.com有关。但是...
在终端[*]中,我在几秒钟内多次运行命令ps aux|grep mysql,然后每次运行命令时,PID编号不断增加:

input$    ps aux|grep mysql
output$   30364 ttys000      0:00.00 grep mysql

(after few seconds) 
input$    ps aux|grep mysql
output$   30366 ttys000    0:00.00 grep mysql

(after few seconds)
input$    ps aux|grep mysql
output$   30368 ttys000    0:00.00 grep mysql

...

(after few minutes)
input$    ps aux|grep mysql
output$   36322 ttys000    0:00.00 grep mysql

...

(after few hours)
input$    ps aux|grep mysql
output$   71252 ttys000    0:00.00 grep mysql

...

这很奇怪。而且,这不允许我关闭/杀死所有正在运行的mysql进程,因为每隔几秒钟就会创建一个新的mysql进程,即使使用sudo killall -9 mysql。此外,在/tmp/文件夹中,每隔几秒钟就会自动创建和删除mysql.sock.lock和mysqlx.sock.lock文件!
我阅读并尝试了许多可能的解决方案**(例如thisthisthis),包括this one,但mysql PID继续增加。
我怎样才能解决这个问题?有什么建议吗?
注:我从一台基于Intel的旧Mac迁移到了一台基于ARM的Mac。
[*]
终端,如果这个信息可以帮助你来帮助我,输出这个当我启动它:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

[**]
下面是我为了阻止mysql创建/删除新进程和文件而尝试的几件事,没有成功:

  • 尝试1 *-使用系统设置小部件,但MySQL Workbench的开始/停止按钮根本不起作用。我还尝试在系统设置〉常规〉登录项中停用mysqld_safe,但没有成功。
  • 尝试2 *-通过自制程序(brew)和二进制文件(下载的. pkg)安装和卸载MySQL(Workbench Arm64版本),并多次重新启动操作系统。
  • 尝试3 *-使用终端:
(with mysql installed via homebrew)
$ brew services stop mysql
==> Downloading https://formulae.brew.sh/api/formula.json
Warning: Service `mysql` is not started.

$ mysql.server stop
ERROR! MySQL server PID file could not be found!

$ /usr/local/bin/mysql.server stop
-bash: /usr/local/bin/mysql.server: No such file or directory

$ sudo killall -9 mysql
Password: ******
No matching processes were found
  • 其他 *
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

$ brew services start mysql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/<MyUserName>/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.

$ sudo brew services start mysql
Warning: Taking root:admin ownership of some mysql paths:
  /opt/homebrew/Cellar/mysql/8.0.32/bin
  /opt/homebrew/Cellar/mysql/8.0.32/bin/mysqld_safe
  /opt/homebrew/opt/mysql
  /opt/homebrew/opt/mysql/bin
  /opt/homebrew/var/homebrew/linked/mysql
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: mysql must be run as non-root to start at user login!
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)

$ mysqld_safe
2023-02-21T23:19:50.6NZ mysqld_safe Logging to '/opt/homebrew/var/mysql/<MyMacName>.lan.err'.
2023-02-21T23:19:50.6NZ mysqld_safe Starting mysqld daemon with databases from /opt/homebrew/var/mysql
2023-02-21T23:19:51.6NZ mysqld_safe mysqld from pid file /opt/homebrew/var/mysql/<MyMacName>.lan.pid ended
fhity93d

fhity93d1#

解决了,至少使MySQL工作在我的Arm 64苹果硅!
其中,这个问题与mysql文件和文件夹的权限被拒绝有关。
在安装了pkg mysql-8.0.31-macos12-x86_64.dmg(在arm 64苹果硅上)之后,我遵循了this
现在,它 * 似乎 * 工作

相关问题