If you cant acces to mysql server as a root you should delete or cannot restore all root records in mysql.user table, delete all of them and add a new record.
You should use mysql PASSWORD() function to hash your cleartext password.
check for more information http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html
First stop mysql server and launch mysqld with --skip-grant-tables.
[root@mysql ~]# service mysqld stop; mysqld_safe --skip-grant-tables &
Hash your cleartext password.
mysql> select PASSWORD('CLEARTEXT_PASSWORD');
+-------------------------------------------+
| PASSWORD('CLEARTEXT_PASSWORD') |
+-------------------------------------------+
| *1EADAEB11872E413816FE51216C9134766DF39F9 |
+-------------------------------------------+
1 row in set (0.00 sec)
Use mysql database to apply changes.
mysql> use mysql;
Delete all root records
mysql> delete from user where User='root';
Add new record that root user can access with all privileges from your ip adress.
mysql> insert into `user` VALUES('YOUR_IP_ADDRESS','root','*1EADAEB11872E413816FE51216C9134766DF39F9','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
Flush changes.
mysql> FLUSH PRIVILEGES;
Exit from mysql command line .
mysql> exit;
Restart mysqld service.
[root@mysql ~]# /etc/init.d/mysqld restart
if you run this mysql commands/ queries you will get a new access to mysql server.