Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a webserver there is a MySQL-service running, providing databases for the users of the server. Each user has it's own DB and it's own password and the right so INSERT/SELECT/UPDATE/DROP tables in it's own DB, but nothing more.

However, i want to give the user the privilege to UPDATE his own password. I've read " GRANT Syntax" from the MySQL 5.1 documentation. But i didn't found a way to grant the user the privilege to change his password, without granting full UPDATE-access to the mysql.user-table.

Maybe there is also a way to synchronize the passwords in /etc/shadow along with the passwords in mysql.user, so, each time when the user changes his password in Linux, the MySQL-password is also altered.

Regards Macs

share|improve this question
up vote 3 down vote accepted

I don't think you need a special permission for doing that.
I just created a new user (GRANT USAGE only) and was able to change my password via:

SET PASSWORD = password('bla');
share|improve this answer
Hm, one of my students tried this today, without success. I just tried it with success. I'll write him that he shall try it again. Thanks. – Sebastian Dressler Oct 8 '10 at 18:46

GRANT UPDATE will basically allow that user to update the mysql table which is a bad thing to do. i would suspect a script is needed here - if you want to sync with the linux system password too then I would suspect you need a wrapper script which takes a password, changes linux password and then updates the mysql password too - you'd need and executable but not readable permission set on this file I should think or hide it behind a web interface.

share|improve this answer

Your Answer


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.