# mysql - root password reset

## Joseph_sys

I'm trying to reset mysql root password but I'm getting nowhere.

```
/etc/init.d/mysql stop

mysqld_safe --skip-grant-tables 
```

 I get:

110622 13:54:57 mysqld_safe Logging to '/var/log/mysql/mysqld.err'.

110622 13:54:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

from another terminal 

```
mysql --user=root mysql

...

mysql> update user set Password=PASSWORD('new') where user='root';

Query OK, 2 rows affected, 2 warnings (0.00 sec)

Rows matched: 2  Changed: 2  Warnings: 2

mysql> flush privileges;

ERROR 1146 (42S02): Table 'mysql.procs_priv' doesn't exist
```

Privileges are not flashed so I guess it doesn't work.  

Note, I was trying upgrade "root" to assign privileges but for some reason or another root did not have access to privilege table.

What to do?

----------

## Joseph_sys

I've tried 

```

cat /usr/share/mysql/mysql_fix_privilege_tables.sql | mysql --no-defaults --force --user=root -p --host=localhost --database=mysql

Enter password: 

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
```

Since I can not change the password I can not fix privilege_tables

----------

## magic919

I probably try mysql_fix_privilege_tables.

----------

## Joseph_sys

 *magic919 wrote:*   

> I probably try mysql_fix_privilege_tables.

 

I ended up reinstalling mysql; couldn't fix it.

I couldn't run "mysql_fix_privilege_tables" as I did not run mysql_update before and I reset the password so something went wrong.

----------

## Raffaello22

 *Joseph_sys wrote:*   

> I'm trying to reset mysql root password but I'm getting nowhere.
> 
> 

 

Hello,

Try this way:

```

mysqladmin -u root -p'old' password new_password

```

----------

