• Register
0 votes
72 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 79 views
0 votes
1 answer 23 views
0 votes
1 answer 71 views
0 votes
1 answer 41 views
41 views
Problem: I had installed MySQL on my linux server sometimes back now I forgot the password so I tried to change it using the ways I found online. What I did was as shown below: /etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql --user root mysql SELECT * ... it still shows me below errors  "Access denied for user 'root'@'localhost' (using password: Yes)". How to fix above MYSql error?
asked Jul 14, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 487 views
487 views
Problem : I am na&iuml;ve to mysql. Currently I am continuously facing below error. &ldquo;Mysql access denied for user 'root'@'localhost' (using password yes)&rdquo;. I have recently started using mySQL Workbench and after doing research on above error I found that my root's ... of no us. I want to get my root access back as soon as possible. Can somebody help me in getting my root access back?
asked Apr 7, 2020 morrisBson 3.2k points
0 votes
1 answer 80 views
80 views
Problem : I am new to MySql. The problem started when I was unable to login to Mysql using my Mysql console. It is repeatedly asking me the password and now I am unable to remember my password. Can I change my password ? And now when I am trying to open my PhpMyAdmin ... WAMP and after that deleted all my related files and then reinstalled it .But it did not fix my issue. How can I fix the issue ?
asked Feb 26, 2020 mphil 2.3k points
0 votes
2 answers 761 views
761 views
Problem : Whenever I want to open a mysql in my windows cmd by simply typing mysql. I am facing below error : &ldquo;ERROR 1045 (28000): Access denied for user ODBC@localhost (using password: NO)&rdquo; After that by looking at similar queries I somehow got the ... password=root ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password:NO) Any pointers will be the great help.
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 1.4K views
1.4K views
Problem : I am new to NodeJS and trying to connect to mySQL through the NodeJS file, however I am facing the below error : { Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES) at Handshake.Sequence._packetToError (/home/alecxe/Node ... bar" AS second_field', function(err, results, fields) { console.log(err); console.log(results); myconnection.end(); } );
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 12 views
1 vote
2 answers 34 views
34 views
Problem : I am very new to the mysql. I am trying to create the new user in the mysql with below syntax: create user 'MyUser'@'localhost' identified by 'password'; But I am always facing below error: &ldquo;Your password does not satisfy the current policy requirements. ... working. I am trying to fix the above error from many hours but still no success. Can someone help me in fixing it for me?
asked Apr 1, 2020 morrisBson 3.2k points