Bearbeiten 12.10.2020:
Ich verwende macOS 10.15.7, die Versionen in Brühformeln sind 10.5.6
für mariadb
und 8.0.21
für mysql. (Sie können sie einchecken /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/{mariadb,mysql}.rb
).
Mysql funktioniert gut nach einer sauberen Installation durch brew uninstall mysql
und dem Entfernen aller verwandten Elemente in $(brew --prefix)
, aber Mariadb funktioniert immer noch nicht brew unlink mysql && brew link mariadb && brew services start mariadb
ohne Entfernen von MySQL-Datenbankdateien in $(brew --prefix)
.
Ursprüngliche Frage:
Ich verwende also macOS 10.15.2 Catalina und versuche, mariadb
(10.4.11, die neueste Version) mit Homebrew zu installieren.
Nach dem Ausführen brew install mariadb
warnte Brew, dass die postinstalllation
nicht erfolgreich abgeschlossen wurde:
==> Postinstalling mariadb
==> /usr/local/Cellar/mariadb/10.4.11/bin/mysql_install_db --verbose --user=me --basedir=/usr/local/Cellar/mariadb/10.4.11 --datadir=
Last 15 lines from /Users/me/Library/Logs/Homebrew/mariadb/post_install.01.mysql_install_db:
shell> /usr/local/Cellar/mariadb/10.4.11/bin/mysql -u root mysql
mysql> show tables;
Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /usr/local/var/mysql that may be helpful.
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss
Please check all of the above before submitting a bug report
at http://mariadb.org/jira
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mariadb`
Ich bin neu bei mariadb / mysql und habe diese Anleitung von mariadb.com befolgt (wie @klanomath darauf hingewiesen hat, dass dies veraltet ist (2016)) und Folgendes ausgeführt habe mysql_install_db
:
$ mysql_install_db
WARNING: The host 'mymac' could not be looked up with /usr/local/Cellar/mariadb/10.4.11/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/usr/local/var/mysql' ...
2020-02-07 20:26:33 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2020-02-07 20:26:33 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-02-07 20:26:33 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-02-07 20:26:33 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-02-07 20:26:33 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-02-07 20:26:33 0 [ERROR] Aborting
Und das Protokoll von mysqld
:
$ mysqld --general-log
2020-02-07 20:44:45 0 [Note] mysqld (mysqld 10.4.11-MariaDB-log) starting as process 78097 ...
2020-02-07 20:44:45 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2020-02-07 20:44:45 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-02-07 20:44:45 0 [Note] InnoDB: Uses event mutexes
2020-02-07 20:44:45 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-02-07 20:44:45 0 [Note] InnoDB: Number of pools: 1
2020-02-07 20:44:45 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-02-07 20:44:45 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-02-07 20:44:45 0 [Note] InnoDB: Completed initialization of buffer pool
2020-02-07 20:44:45 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2020-02-07 20:44:45 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-02-07 20:44:46 0 [Note] InnoDB: Starting shutdown...
2020-02-07 20:44:46 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-02-07 20:44:46 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-02-07 20:44:46 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-02-07 20:44:46 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-02-07 20:44:46 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-02-07 20:44:46 0 [ERROR] Aborting
Ich habe etwas recherchiert, konnte aber nichts hilfreiches finden. Wie schließe ich mariadb
die Installation ab? Jede Hilfe ist willkommen!
Ich habe eine Lösung, die für mich funktioniert hat. Ich habe versucht, die neueste Version von Mariadb (10.5.6) zu installieren. Stoppen Sie zuerst alle mysql-Dienste, die möglicherweise ausgeführt werden
brew services stop mariadb
Als nächstes müssen Sie den Inhalt von löschen/usr/local/var/mysql
sudo rm -rf /usr/local/var/mysql
Anschließend müssen Sie die Datenbankinstallationsdateien erstellen
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Dadurch wird der Speicherort des Mariadb-Kellers abgerufen, wie er von brew installiert wurde, und die Installation der db-Datei durchgeführt. Der nächste Schritt ist das Starten von Mariadbbrew services start mariadb
Wir müssen jetzt ein Passwort einrichten. Kümmern Sie sich nicht um mysql_secure_connection
oder mariadb-secure-connection
. Ich hatte Probleme mit ihnen
Melden Sie sich bei mysql ansudo mariadb -u root
Wir müssen nun das Passwort des Benutzers root ändern
> use mysql;
> ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
> flush privileges;
> quit
Sie können jetzt versuchen, sich bei mariadb anzumeldenmariadb -u root -p
klanomath
brew list
! Übrigens: Ich hatte kein Problem damit, Mariadb 10.4.11 in meiner Lab-Umgebung zu installieren.Teddy C
brew list
sind nur Hunderte von Formelzeilen, die ich installiert habe, einschließlichmariadb
der neuesten Version, ohne frühere Version.Teddy C
brew list
, kein Percona * oder MySQL :)Teddy C
klanomath
PhillipMwaniki