Homebrew-core: Can't connect to MySQL using instructions

Created on 2 Mar 2017  路  3Comments  路  Source: Homebrew/homebrew-core

Expectation: mysql -uroot command from instructions log me in.
Actual: It doesn't work. There's some password that I don't know.

Tejass-MacBook-Pro:presto tejas$ brew install mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.17.el_capitan.bottle.1.tar.gz
Already downloaded: /Users/tejas/Library/Caches/Homebrew/mysql-5.7.17.el_capitan.bottle.1.tar.gz
==> Pouring mysql-5.7.17.el_capitan.bottle.1.tar.gz
==> Using the sandbox
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

To connect run:
    mysql -uroot

To have launchd start mysql now and restart at login:
  brew services start mysql
Or, if you don't want/need a background service you can just run:
  mysql.server start
==> Summary
馃嵑  /usr/local/Cellar/mysql/5.7.17: 321 files, 234.4M
Tejass-MacBook-Pro:presto tejas$ mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Most helpful comment

You will have had an existing database with an existing password there. To remove all your data and start again run brew services stop mysql; pkill mysqld; rm -rf /usr/local/var/mysql/; brew postinstall mysql; brew services restart mysql

All 3 comments

You will have had an existing database with an existing password there. To remove all your data and start again run brew services stop mysql; pkill mysqld; rm -rf /usr/local/var/mysql/; brew postinstall mysql; brew services restart mysql

@MikeMcQuaid , thank you for this.

@ldco2016 Thanks for the kind words!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bantl23 picture bantl23  路  3Comments

sstadick picture sstadick  路  4Comments

BluePawDev picture BluePawDev  路  3Comments

yuna9 picture yuna9  路  4Comments

kiendang picture kiendang  路  3Comments