首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mac Big Sur MariaDB无法运行

Mac Big Sur MariaDB无法运行
EN

Stack Overflow用户
提问于 2021-09-13 08:11:14
回答 1查看 1K关注 0票数 1

MariaDB运行良好,但现在无法在启动时运行。我已经卸载,然后它重新安装它,这并没有修复任何问题。

以下是mysql.server.start的输出

mysql.server启动

代码语言:javascript
复制
Starting MariaDB
.210913 10:08:11 mysqld_safe Logging to '/usr/local/var/mysql/xxxx-MacBookPro.local.err'.
210913 10:08:11 mysqld_safe Starting mariadbd daemon with databases from /usr/local/var/mysql
/usr/local/bin/mysql.server: line 264: kill: (4944) - No such process
 ERROR! 

这是我从brew info mariadb得到的

代码语言:javascript
复制
mariadb: stable 10.6.4 (bottled)
Drop-in replacement for MySQL
https://mariadb.org/
Conflicts with:
  mariadb-connector-c (because both install `mariadb_config`)
  mysql (because mariadb, mysql, and percona install the same binaries)
  mytop (because both install `mytop` binaries)
  percona-server (because mariadb, mysql, and percona install the same binaries)
/usr/local/Cellar/mariadb/10.6.4 (902 files, 183MB) *
  Poured from bottle on 2021-09-13 at 09:49:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/mariadb.rb
License: GPL-2.0-only
==> Dependencies
Build: bison ✘, cmake ✘, pkg-config ✘
Required: groonga ✔, openssl@1.1 ✔, pcre2 ✔
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

MySQL is configured to only allow connections from localhost by default

To have launchd start mariadb now and restart at login:
  brew services start mariadb
Or, if you don't want/need a background service you can just run:
  mysql.server start
==> Analytics
install: 13,312 (30 days), 41,010 (90 days), 166,455 (365 days)
install-on-request: 13,289 (30 days), 40,949 (90 days), 165,680 (365 days)
build-error: 0 (30 days)

以下是我从brew services list获得的内容

代码语言:javascript
复制
dnsmasq   stopped                  
httpd     error   xxxx /usr/local/opt/httpd/homebrew.mxcl.httpd.plist
mariadb    xxxx /usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist
mysql@5.7  xxxx /usr/local/opt/mysql@5.7/homebrew.mxcl.mysql@5.7.plist
nginx     stopped                  
php@5.6   stopped                  
php@7.0   stopped                  
php@7.3   stopped                  
php@7.4   stopped     

mac成功地提供了PHP,当代码试图与数据库对话时,PHP会抛出一个“连接被拒绝”的错误。因此,如果apache看起来正在运行,我并不能真正理解httpd错误。

以下是错误日志的内容(谢谢DanBlack)

这是来自/usr/local/var/mysql/xxxx-MacBookPro.local.err

代码语言:javascript
复制
2021-09-16T15:30:12.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/XXXX-MacBookPro.local.pid ended
210916 17:30:13 mysqld_safe Starting mariadbd daemon with databases from /usr/local/var/mysql
2021-09-16 17:30:13 0 [Note] /usr/local/opt/mariadb/bin/mariadbd (server 10.6.4-MariaDB) starting as process 33244 ...
2021-09-16 17:30:13 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
/usr/local/opt/mariadb/bin/mariadbd: Please consult the Knowledge Base to find out how to run mysqld as root!
2021-09-16 17:30:13 0 [ERROR] Aborting
210916 17:30:13 mysqld_safe mysqld from pid file /usr/local/var/mysql/XXXX-MacBookPro.local.pid ended
2021-09-16T15:30:21.6NZ mysqld_safe Logging to '/usr/local/var/mysql/XXXX-MacBookPro.local.err'.
2021-09-16T15:30:21.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2021-09-16T15:30:21.651835Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-09-16T15:30:21.652151Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2021-09-16T15:30:21.652197Z 0 [Note] /usr/local/opt/mysql@5.7/bin/mysqld (mysqld 5.7.35) starting as process 33337 ...
2021-09-16T15:30:21.655210Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2021-09-16T15:30:21.656555Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-09-16T15:30:21.656576Z 0 [Note] InnoDB: Uses event mutexes
2021-09-16T15:30:21.656585Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-09-16T15:30:21.656593Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-09-16T15:30:21.658530Z 0 [Note] InnoDB: Number of pools: 1
2021-09-16T15:30:21.658624Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-09-16T15:30:21.659813Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-09-16T15:30:21.668320Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-09-16T15:30:21.719277Z 0 [ERROR] InnoDB: Only one log file found.
2021-09-16T15:30:21.719324Z 0 [ERROR] InnoDB: Plugin initialization aborted with error not found
2021-09-16T15:30:22.233348Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-09-16T15:30:22.233372Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-09-16T15:30:22.233382Z 0 [ERROR] Failed to initialize builtin plugins.
2021-09-16T15:30:22.233390Z 0 [ERROR] Aborting

2021-09-16T15:30:22.233402Z 0 [Note] Binlog end
2021-09-16T15:30:22.233465Z 0 [Note] Shutting down plugin 'CSV'
2021-09-16T15:30:22.233770Z 0 [Note] /usr/local/opt/mysql@5.7/bin/mysqld: Shutdown complete

这每隔几秒钟就会重复一次。

但是,我现在可以连接到本地主机mysql服务器并使用mysql databases @ 127.0.0.1运行已删除/usr/local/var/mysql/ib_logfile0的内容

EN

回答 1

Stack Overflow用户

发布于 2021-10-15 04:39:19

遇到了同样的问题。Mariadb与我的M1 mac上之前安装的mysql有冲突。删除/opt/homebrew/var/mysql/文件夹并重新安装mariadb。现在可以正常工作了。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69159310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档