Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mariadb 10.4 root cannot connect #41707

Closed
6 tasks done
minusf opened this issue Jul 8, 2019 · 9 comments
Closed
6 tasks done

mariadb 10.4 root cannot connect #41707

minusf opened this issue Jul 8, 2019 · 9 comments
Labels
outdated PR was locked due to age

Comments

@minusf
Copy link
Contributor

minusf commented Jul 8, 2019

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.

  • 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
  • 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.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • 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)]> 
@qnox81
Copy link

qnox81 commented Jul 8, 2019

you can try:

sudo mysql -u root

@SMillerDev
Copy link
Member

That's meant to happen https://mariadb.com/kb/en/library/authentication-from-mariadb-104/

@minusf
Copy link
Contributor Author

minusf commented Jul 8, 2019 via email

@minusf
Copy link
Contributor Author

minusf commented Jul 8, 2019

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

$ sudo mysql -uroot
Password:

@qnox81
Copy link

qnox81 commented Jul 8, 2019

i guess its your account on mac password for sudo

@minusf
Copy link
Contributor Author

minusf commented Jul 8, 2019

doh... yes, that's correct.

@JustSteveKing
Copy link

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?

@SMillerDev
Copy link
Member

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.

@shuliangfu
Copy link

you can try:
mysql_secure_installation

@lock lock bot added the outdated PR was locked due to age label Jan 1, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

5 participants