Harvester Haidar
Harvester Haidar

Reputation: 553

MySQL change root default password on Mac OS X

I tried changing MySQL root password right after installing it. Now on terminal, it says to check out some newer query ALERT USER. I checked the documentation, but it's still the old query CHANGE PASSWORD

Any help please

Upvotes: 0

Views: 1060

Answers (3)

LCL
LCL

Reputation: 57

If anyone has trouble with the mysql -u root -p command but know the current MySQL password and has MySQL Workbench installed, just try to start a command line client by right clicking your localhost connection in MySQL Workbench:

enter image description here

Once the command line client started, enter your current MySQL password when prompted in terminal. After that, use the ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password' command.

Using Mac M1 MacBook and mysql version 8.0.30

Upvotes: 1

Seong Marcus
Seong Marcus

Reputation: 11

instruction that worked with my case.

mysql -uroot -p (default root password is blank with brew install)

  1. use mysql;
  2. ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

That's it. ( Mac M1 MacBook, mysql installed with brew, mysql version 8.0.28 for macos12.0 on arm64 (Homebrew) )

Upvotes: 1

Harvester Haidar
Harvester Haidar

Reputation: 553

Ok i found a way to change the root password from workbench i just clicked on "local instance 3306" in the home page and gave me a choice to change root password, it's even easier than changing it from the terminal !

Upvotes: 2

Related Questions