3

Unable to reset mysql password for my Ubuntu machine. I followed the instruction below.

https://help.ubuntu.com/community/MysqlPasswordReset

But I get the following error

sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking 151109 20:04:43 [Note] /usr/sbin/mysqld (mysqld 5.5.45) starting as process 18720 ... 151109 20:04:43 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 151109 20:04:43 [ERROR] Aborting 151109 20:04:43 [Note] /usr/sbin/mysqld: Shutdown complete 

2 Answers 2

4

Try:

sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking --user=mysql

Sign up to request clarification or add additional context in comments.

Comments

2

Perhaps this page might be of use. I copy-pasted the snippet for generic systems, as you didn't indicate whether you are using Unix or Windows:

  1. Stop the MySQL server if necessary, then restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges, and disables account-management statements such as ALTER USER and SET PASSWORD. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.
  2. Connect to the MySQL server using the mysql client; no password is necessary because the server was started with --skip-grant-tables: mysql
  3. In the mysql client, tell the server to reload the grant tables so that account-management statements work: FLUSH PRIVILEGES;

Now you can change the root password like any other user, e.g. using set password or alter user.

Hope that helps...

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.