in MySQL

MySQL > How to change root password on Mevericks

I don’t know why the message that is the following thing is shown when i try to login on console.

Access denied for user ‘root’@’localhost’ (using password: NO)

So I’ve tried few ways.

These things didn’t work for me.

  1. mysqladmin -u root password ‘newpw’

  2. when i logged in just ‘mysql’ and then typed like those. 2.1 UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’; 2.2 FLUSH PRIVILEGES;

The following things work for me.

You’ve to use try /usr/local/mysql/bin/mysqld_safe

and then

  1. UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’;
  2. FLUSH PRIVILEGES;

You can see the successful message.

Write a Comment

Comment