I've just installed MySQL through MySQL Package Installer. After the installation, this message:
UPDATE mysql.user SET authenticationstring = PASSWORD('MyNewPass'), passwordexpired = 'N' WHERE User = 'root' AND Host = 'localhost'; FLUSH PRIVILEGES; B.4.3.2.3 Resetting the Root Password: Generic Instructions. I have been trying to reset my MySQL root password. I have run the mysqldsafe -skip-grant-tables, updated the root password, and checked the user table to make sure it is there. Once restarting the mysql daemon I tried logging in with the new root password that I just set and still get Access denied for user 'root' errors. This is the MySQL™ Reference Manual. It documents MySQL 5.7 through 5.7.28, as well as NDB Cluster releases based on version 7.5 of NDB through 5.7.27-ndb-7.5.16, respectively. It may include documentation of features of MySQL versions that have not yet been released. Since december 1996, Mac OS is built upon a unix kernel. So I assume the commands for Unix/Linux, indicated in the link I provided, will work. Thus, corresponding section you should have a look at is B.5.3.2.2 Resetting the Root Password: Unix and Unix-Like Systems.
Then I've tried to log using Sequel Pro to127.0.0.1 / root / #<;Ay.
and this is the result:
and this is the result from MySQL WorkBench
So I've tried
1)
2)
3)
4)
5)
2 Answers
Nuñito de la CalzadaMysql Reference Manual Reset Password Machine
Nuñito de la CalzadaFind out which user the mysql server is running as using ps au | grep mysqld
. sudo
to said user and run update user set password=PASSWORD('NEW_PASSWORD_HERE') where User=user()
. Hope that helps.
Not the answer you're looking for? Browse other questions tagged mysqlmacos or ask your own question.
I'm using SequelPro (http://www.sequelpro.com/)and I would like to know how to reset my root password.I'm trying to log in as
host: localhost
username: root
password: (BLANK)
But I keep getting this error:
Unable to connect to host because access was denied.
Double-check your username and password and ensure that access from your current location is permitted.
MySQL said: Access denied for user 'root'@'localhost' (using password: NO)
Any suggestions?!
Josh K2 Answers
Depending on what you're using to run MySQL, you could take a look at the official instructions.
If you're using MAMP or something similar you need to find where mysqladmin
is located.
If you are using another installation of mysql, you may be able to find out where it is located with:
Here is the procedure to reset password of root user.
1) Stop mysql (Kill mysql process or run following command)
2) Start it in safe mode
3) Open another terminal and run the following command (Keep last terminal open)
4) Run the following command with suitable new password on the mysql console
5) mysql > FLUSH PRIVILEGES;
6) Quit from both terminals and open new terminal and connect to mysql with root user and new password