Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JuanLuisGarciaBorrego's full-sized avatar
🏠
Working from home

Juan Luis García Borrego JuanLuisGarciaBorrego

🏠
Working from home
View GitHub Profile
@JuanLuisGarciaBorrego
JuanLuisGarciaBorrego / mariadb-brew-macos.md
Created August 3, 2022 10:43 — forked from nickcernis/mariadb-brew-macos.md
Install MariaDB with brew on macOS and fix the “access denied” issue

Attempting mysql -u root fails with Access denied for user 'root'@'localhost immediately after doing brew install mariadb and starting mariadb with brew services start mariadb.

To fix it (with MariaDB still running):

  1. sudo mysql then enter your Mac user password
  2. ALTER USER 'root'@'localhost' IDENTIFIED BY 'newrootpassword'; replacing newrootpassword with the password you wish to use for the MariaDB root user.
  3. Ctrl-C to exit mysql.

You should then be able to connect to MariaDB with mysql -u root -p, then entering the root password when prompted.