Добавляем в файл /etc/my.cnf
В секцию [mysqld] следующее

skip-grant-tables
и ребутим сервере
deathstar# /usr/local/etc/rc.d/mysql-server restart
Выполняем
Пароль не вводим жмем enter

deathstar# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.1.57 FreeBSD port: mysql-server-5.1.57

И выполняем запрос

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> UPDATE mysql.user SET password = PASSWORD('пароль') WHERE user = 'root' AND host = 'localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> Ctrl-C -- exit!
Aborted

Потом убираем изменения в /etc/my.cnf
и ребутим сервер MySQL — все,доступ получен