• Register
0 votes
107 views

Problem :

I am very much new to the whole Mac experience. I have recently installed MySQL on Mac and it is asking me to reset the password after install. It is not allowing me to do anything else.

Now I have already reset the password the usual way as below:

update user set password = password('XXX') where user = root;

Unfortunately again it seems I need to change the password but in some different way that is not known to me. Can someone here has any solution on my problem?

6 5 3
7,540 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

Please Run below commands:

$ cd /usr/local/mysql/bin
$ ./mysqladmin -u root password 'password'

Then run below commands

./mysql -u root

Now it should log in. Now just run FLUSH privileges;

Then you need to exit the MySQL console and try logging in again. If that doesn't work run these below commands:

$ mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET authentication_string=PASSWORD("XXXXXXX") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

Please change xxxxxx to your new password. After that try logging in again.

If you are on the oracle try following command:

ALTER USER username IDENTIFIED BY password

Further Readings :

See this http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

It should give more information on your problem.

9 7 4
38,600 points
0 votes

Solution:

In case this is NOT your first time setting up the password, attempt this method:

mysql> UPDATE mysql.user SET Password=PASSWORD('your_new_password')
           WHERE User='root'; 

And in case you obtain the pursuing error, there is a high probability that you have never place your password before:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

To place up your password for the first time:

mysql> SET PASSWORD = PASSWORD('your_new_password');
Query OK, 0 rows affected, 1 warning (0.01 sec)

In case you explained mysql employing mysql -u root -p

Try ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

First, log in mysql with sandbox mode

mysql -u <user> -p --connect-expired-password

Thereafter, place password

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('XXXX');

Query OK, 0 rows affected, 1 warning (0.01 sec)

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 3 views
3 views
Problem: I am trying to change the MySql root password. How can I change password, which does not exist? Please HELP! Thanks!
asked Mar 16 ummesalma 22k points
0 votes
1 answer 2 views
2 views
Problem: Please help me fix this dilemma: the order by clause must be placed before the where clause in a sql statement.
asked Apr 1 rakib1 50.6k points
0 votes
1 answer 1 view
1 view
Problem: I am facing problem with mysql non root/admin user, I am following the below steps for creating user and its privileges, correct me if i am doing wrong, i am installing mysql on RHEL 5.7 64bit, packages are mentioned below, once i done the rpm install we ... Access denied for user 'golden'@'localhost' (using password: YES) This is the problem I am facing, is there any solution to this?
asked 1 day ago Atik03 4.1k points
0 votes
1 answer 2 views
2 views
Problem java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)? How is this caused and how can I solve it?
asked 2 days ago neeraj 9.5k points
0 votes
1 answer 2 views
2 views
Problem: As I mentioned in my previous query, I'm having difficulties with my learning; I've tried searching the web but haven't been able to find adequate information; could you assist me in continuing my project?
asked Apr 1 rakib1 50.6k points
0 votes
1 answer 3 views
3 views
Problem: Please assist me in resolving this issue: Access denied for user 'root'@'localhost' (using password no) mysql?
asked Mar 30 tuhin1 46.7k points
0 votes
1 answer 5 views
5 views
Problem: I'm having trouble finding a solution; could you please assist me &ldquo;Access denied for user 'root'@'localhost' (using password yes) mysql&rdquo;?
asked Mar 30 tuhin1 46.7k points
0 votes
1 answer 5 views
5 views
Problem: Please help me fix this dilemma &ldquo;Access denied for user 'root'@'localhost' using password yes mysql&rdquo;?
asked Mar 30 tuhin1 46.7k points
0 votes
1 answer 6 views
6 views
Problem: I'm having problems during my learning as I mentioned in my question above, I try to find on web search but I can't get proper information, can you help me to continue my project?
asked Mar 21 shamimkhan 15.1k points
0 votes
1 answer 5 views
5 views
Problem: How to deal with this one : Er_access_denied_error: access denied for user 'root'@'localhost' (using password: no)
asked Mar 14 Wafa Abu Yousef 6.1k points