xpf0000 / PhpWebStudy

Powerful Web and PHP Development Environment. Support both macOS and windows
https://www.macphpstudy.com
BSD 3-Clause "New" or "Revised" License
519 stars 42 forks source link

Error Installing MariaDB #83

Closed xcrap closed 2 months ago

xcrap commented 2 months ago

I'm having the following error installing MariaDB 11.3.2

Command: /opt/homebrew/Cellar/mariadb/11.3.2/bin/mysql_install_db --datadir=/Users/xcrap/Library/PhpWebStudy/server/mariadb/data-11.3 --basedir=/opt/homebrew/Cellar/mariadb/11.3.2/ --auth-root-authentication-method=normal Installing MariaDB/MySQL system tables in '/Users/xcrap/Library/PhpWebStudy/server/mariadb/data-11.3' ...

2024-04-21 5:05:49 0 [ERROR] /opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadbd: unknown variable 'mysqlx-bind-address=127.0.0.1' 2024-04-21 5:05:49 0 [ERROR] Aborting

Installation of system tables failed! Examine the logs in /Users/xcrap/Library/PhpWebStudy/server/mariadb/data-11.3 for more information.

The problem could be conflicting information in an external

my.cnf files. You can ignore these by doing:

shell> /opt/homebrew/Cellar/mariadb/11.3.2/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mariadbd daemon with:

shell> /opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadbd --skip-grant-tables --general-log &

and use the command line tool /opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadb to connect to the mysql database and look at the grant tables:

shell> /opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadb -u root mysql
MariaDB> show tables;

Try '/opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadbd --help' if you have problems with paths. Using --general-log gives you a log in /Users/xcrap/Library/PhpWebStudy/server/mariadb/data-11.3 that may be helpful.

The latest information about mariadb-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 https://mariadb.org/jira

Error: 2024-04-21 5:05:49 0 [ERROR] /opt/homebrew/Cellar/mariadb/11.3.2//bin/mariadbd: unknown variable 'mysqlx-bind-address=127.0.0.1' 2024-04-21 5:05:49 0 [ERROR] Aborting

xcrap commented 2 months ago

It's possible this is related with an early installation of Mysql, so I have installed Mysql and uninstalled before trying to install MariaDB and this may be the reason this is happening.

xpf0000 commented 2 months ago

I find this: https://stackoverflow.com/questions/58245118/warning-the-post-install-step-did-not-complete-successfully-when-trying-to-ins

looks like mysql and mariadb use the same my.cnf file when use brew install. However, the contents of their configuration files are slightly different.

I tested it locally. The problem is reproduced.

  1. Delete /opt/homebrew/etc/my.cnf, restore the brew environment to the point where mysql and mariadb are not installed.

  2. Install mysql 8.3 with brew. /opt/homebrew/etc/my.cnf file is created, containing: mysqlx-bind-address = 127.0.0.1. This causes the downstream mariadb installation to fail.

Further attempts. Only if mysql version is greater than or equal to 8.0. /opt/homebrew/etc/my.cnf will contain mysqlx-bind-address = 127.0.0.1. If mysql 5.7 was installed first. then everything is fine.

xcrap commented 2 months ago

Yes I've also seen that post but I wanted to ask first before anything else.

Anyway I just backup my my.cnf as my.cnf.backup and reinstalled MariaDB again and worked fine.

It's all good :)