# Setting root password on mysql 5.4



## jaymax (Jan 10, 2010)

Does anyone know how to set root password on a new installation from the post?

Can it be performed after starting the server with
`/usr/local/bin/mysqld_safe &`

Or for that matter with
`/usr/local/bin/mysql_secure_installation`

Thanks!
PS: Tried several approaches, need a new beginning


----------



## dclau (Jan 10, 2010)

From the manual:

`% mysql -u root`
[CMD="mysql>"]SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');[/CMD]

or with _mysqladmin_

`% mysqladmin -u root password "newpwd"`

Good luck.


----------

