Editar 2020-10-12:
Estoy en macOS 10.15.7, las versiones en brew formulas son 10.5.6
para mariadb
y 8.0.21
para mysql. (puedes consultarlos en /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/{mariadb,mysql}.rb
).
Mysql funciona bien después de una instalación limpia brew uninstall mysql
y eliminando todo lo relacionado en $(brew --prefix)
, pero mariadb aún no funcionará brew unlink mysql && brew link mariadb && brew services start mariadb
sin eliminar los archivos de la base de datos mysql en $(brew --prefix)
.
Pregunta inicial:
Así que estoy ejecutando macOS 10.15.2 Catalina e intento instalar mariadb
(10.4.11, la última versión) con Homebrew.
Después de ejecutar brew install mariadb
, brew advirtió que postinstalllation
no se completó con éxito:
==> 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`
Soy nuevo en mariadb / mysql, por lo que seguí esta guía de mariadb.com (como señaló @klanomath, está obsoleta (2016)) y ejecuté 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
Y el registro de 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
Investigué un poco pero no pude encontrar nada útil. ¿ Cómo completo mariadb
la instalación? ¡Cualquier ayuda es apreciada!
Tengo una solución que funcionó para mí. Estaba tratando de instalar la última versión de mariadb (10.5.6) Primero, detenga cualquier servicio mysql que pueda tener en ejecución
brew services stop mariadb
A continuación, debe eliminar el contenido de/usr/local/var/mysql
sudo rm -rf /usr/local/var/mysql
A continuación, debe crear los archivos de instalación de la base de datos.
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Esto obtendrá la ubicación de mariadb Cellar tal como la instaló brew y realizará la instalación del archivo db. El siguiente paso es iniciar mariadbbrew services start mariadb
Ahora necesitamos configurar una contraseña. No te molestes con mysql_secure_connection
o mariadb-secure-connection
. tuve problemas con ellos
Iniciar sesión en mysqlsudo mariadb -u root
Ahora necesitamos cambiar la contraseña del usuario root.
> use mysql;
> ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
> flush privileges;
> quit
Ahora puede intentar iniciar sesión en mariadbmariadb -u root -p
klanomath
brew list
! Por cierto: no tuve ningún problema para instalar mariadb 10.4.11 en mi entorno de laboratorio.osito c
brew list
es solo cientos de líneas de fórmulas que he instalado, incluidamariadb
la última versión, sin incluir la versión anterior.osito c
brew list
, sin percona* o mysql :)osito c
klanomath
FelipeMwaniki