Change your root password mac MySQL

Tide Ayoade
Feb 28, 2024

--

  1. Open your terminal in any directory
  2. Assuming MySQL is installed
sudo mysql -u root ALTER USER 'root'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'your_new_password';

or install using homebrew

Using Homebrew:
brew install mysql
brew tap homebrew/services
brew services start mysql

3. check the response list for my.cnf, file then add the below, save and close the file…

[mysqld]
# For debugging and recovery only #
skip-grant-tables
skip-networking

4. On the open terminal paste and enter the command MySQL -u root -p

Then the below

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';

5. Remove additions at number 3. from my.cnf, file.

6. Test changed root password using the command MySQL -u root -p

Hope you found this very useful, have a great day.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tide Ayoade
Tide Ayoade

Written by Tide Ayoade

Everything Blockchain | Ethereum

No responses yet

What are your thoughts?