Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I changed the root password using Google APIs SQL Prompt from blank to using:

UPDATE mysql.user SET password = PASSWORD('<password>') WHERE user = 'root';

It has been documented here that SQL prompt and some other APIs Services will lose functionality when a password is set on root. (Thanks for Hasturkun's comment below).

How then do we reset the password to <blank>?

share|improve this question

migrated from stackoverflow.com Jul 9 '13 at 6:41

This question came from our site for professional and enthusiast programmers.

    
@DanFromGermany, No, The Execute Button at the Prompt itself is disabled. –  Tabrez Ahmed Jul 7 '13 at 9:12
    
Off topic probably belongs on Database Administrators, also The lovely documentation has this to say: Note that if you add a password to the root MySQL user, the APIs Console Interface will lose some functionality, including import and export capabilities, and the SQL prompt. –  Hasturkun Jul 7 '13 at 9:20
    
@Hasturkun, How to revoke the password then? –  Tabrez Ahmed Jul 7 '13 at 9:23
    
I haven't the faintest, though you might be able to do so with the command line client –  Hasturkun Jul 7 '13 at 9:25
1  
the password is stored hashed, that is why it is a dumb idea to change it using a sql statement... –  SQL.injection Jul 7 '13 at 9:42
add comment

1 Answer 1

up vote 2 down vote accepted

Login to MySQL using current password and then you can change password like this

mysql> SET PASSWORD FOR root@'localhost'=PASSWORD('');
Query OK, 0 rows affected (0.00 sec)

Now you can login MySQL using BLANK password.

This is not the most secure way to change password for better approach please have a look at How to Reset the Root Password.

share|improve this answer
    
Surprisingly, you could also say SET PASSWORD FOR root@'localhost'=''; because PASSWORD('') is ''. +1 !!! –  RolandoMySQLDBA Jul 9 '13 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.