Homebrew-core: mariadb 10.4 root cannot connect

Created on 8 Jul 2019  路  9Comments  路  Source: Homebrew/homebrew-core

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [x] are reporting a bug others will be able to reproduce and not asking a question or requesting software. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh. To get software added or changed in Homebrew please file a Pull Request
  • [x] have a problem with brew install (or upgrade, reinstall) a single, Homebrew/homebrew-core formula (not cask) on macOS? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a Linux problem please file this issue at https://github.com/Homebrew/linuxbrew-core/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [x] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
  • What happened (include command output)
  • What you expected to happen
  • Step-by-step reproduction instructions (by running brew install commands)

After installing latest mariadb, cannot log in as root, only as user performing the install:

$ brew install mariadb
==> Pouring mariadb-10.4.6.mojave.bottle.tar.gz
==> 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 connect:
    mysql -uroot

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
==> Summary
馃嵑  /usr/local/Cellar/mariadb/10.4.6: 745 files, 173.4MB

$ mysql -uroot
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 28
Server version: 10.4.6-MariaDB Homebrew

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
outdated

Most helpful comment

All 9 comments

you can try:

sudo mysql -u root

yes, thanks. but in that case would it possible to update the post install
message to include sudo? as it is, it doesn't work...

FWIW, i am still being asked a password i did not set and don't know...

$ sudo mysql -uroot
Password:

i guess its your account on mac password for sudo

doh... yes, that's correct.

How do I need sudo to run mysql with homebrew? This stops me using a tool such as sequel pro as it cannot connect through the socket?

You don't. That's just if you insist on using the root user, and even then the link I send above has a solution.

you can try:
mysql_secure_installation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Thirudhas picture Thirudhas  路  4Comments

ghostbar picture ghostbar  路  4Comments

gregvirgin picture gregvirgin  路  3Comments

bantl23 picture bantl23  路  3Comments

faraazkhan picture faraazkhan  路  3Comments