# Cannot set password To mysql Freebsd 7.2



## Mimmo91 (Apr 10, 2010)

Hi all,
I have problem with mysql..
i have install it but when i set password with
Cmds: `mysqladmin â€“u root password` (new Password)

the machine say: 
	
	



```
mysqladmin: can't connect to server at 'localhost' failed
error: access denied for user 'root'@'localhost' (using password: no)
```

why? i reinstall mysql but he say this error...


sorry for my english..


----------



## VoViK (Apr 10, 2010)

```
/usr/local/etc/rc.d/mysql-server stop
mv /var/db/mysql /var/db/mysql_old
/usr/local/etc/rc.d/mysql-server start
/usr/local/bin/mysqladmin -u root password 'newpass'
```

Or you can restart mysql with 
	
	



```
--skip-grant-tables
```
  option and reset password.


----------



## gilinko (Apr 10, 2010)

You probably haven't started the mysql server yet, and before that you have to enable it in /etc/rc.conf. As your primary error message was that it couldn't connect. So add _mysql_enable="YES"_ to /etc/rc.conf and then start the server with

```
/usr/local/etc/rc.d/mysql-server start
```

Then you can update your password either from the mysql shell or the mysqladmin tool.


----------



## Mimmo91 (Apr 11, 2010)

VoViK said:
			
		

> ```
> /usr/local/etc/rc.d/mysql-server stop
> mv /var/db/mysql /var/db/mysql_old
> /usr/local/etc/rc.d/mysql-server start
> ...



thanks man! now work!


----------

