Saturday, January 9, 2010

Mysql - recover debian-sys-maint account password

You would need as a Debian user specific start and stop scripts for MySql. These have unfortunately also the implication that Debian also created a separate user with own password: debian-sys-maint. The result of a careless handling of this fact could be that you accidentally overwrite this password, delete the user away, because nothing can do with it.

This will, however, after one "flush priviliges Or restarting the database to the problem.

The next reboot that is running next to it and kills the Debian MySql process. That's a not just at the sight of the console angst, it can have serious consequences. For the commonly used MyISAM table format allgergisch highly responding to a kill command. At least then, you know someone is in the database to write. The table on which was written during the kill command is then in fact be erstmal marked as crashed and should be repaired, which again poses new risks.

It's called security... Since the start and stop being root of the database does not have to. Actually, you should root almost never use it except to create vllt to other users. And since I'm still a question: if you have now overwritten your password and the database is not running anymore, how will you access the database to change the password ... There is still missing the reference vllt then start MySQL manually. Since the start of the script is nothing more.

Restoration of password

The password for the Mysql user debian-sys-maint located in the file /etc/mysql/debian.cnf.

Now only the following is done:

1.log in to the MySql server as root
2.using use mysql switch to the mysql database
3.using update mysql set password = password (Kennword-from-the-configfile) WHERE User = 'debian-sys-maint' password setting
4.flush privileges execute an amendment to incorporate

Alternatively, you can simply reset password in the configuration file. It should be noted that twice in the file. Once a section [client] and once in the section [mysql-upgrade].

No comments:

Post a Comment