# Reset MySQL pw



## bsus (Oct 1, 2011)

Hi,

I messed up my MySQL root-password. Good that there wasn't any data in the mysql-db. I tried already to reinstall MySQL but this didn't work. How do I get MySQL completly removed to set up a new password?

Regards.


----------



## da1 (Oct 1, 2011)

You don;t need to remove it, just shut it down and start it with --skip-grant-tables

```
mysqld_safe --skip-grant-tables &
```
Then, login:
	
	



```
mysql -u root
```
 and you will be presented with the mysql> prompt.
Change your password like so:

```
use mysql;
```


```
update user
set password=PASSWORD('NEWPASSWORD')
where user='root';
```


```
flush privileges;
```
Shut down mysql, and use the script (/usr/local/etc/rc.d/mysql-server start) to start it up again.


PS: google  It helps.


----------



## bsus (Oct 1, 2011)

I had to

```
mysqld_safe --skip-grant-tables &
/usr/local/etc/rc.d/mysql-server start
```
to start mysql then I had access to the direct mysql-db
Thanks for the help


----------

