How to change root password Mysql on Mac

First, Stop mysql server

$ mysql.server stop

Then start mysqld_safe

$ cd /usr/local/Cellar/mysql/5.7.16/bin

$ mysqld_safe –skip-grant-tables &

Connect mysql with root user

$ mysql -uroot mysql

etc) behind mysql is a database name.

Update password of root user. (I’m using a 5.7.16 mysql, you have to use ‘password’ column instead of ‘authentication_string’ column in previous version.)

$ update user set authentication_string=password([changed_password]) where user=’root’;

Flush previleage and quit

$ flush privileges;

$ quit

And then check if it is changed correctly.

$ mysql.server start

$ mysql -uroot -p

Enter password: [type a changed password]

If you connect mysql, your password changed correctly.

http://codingisgame.tistory.com/13

https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/

screenshot-2016-10-23-20-19-27screenshot-2016-10-23-20-18-27screenshot-2016-10-23-20-18-46

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s