LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2004, 04:52 AM   #1
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Rep: Reputation: 18
mysql: debian-sys-maint password changed by accident, possible to change it back?


Hi,
I have mysql running on my knoppix debian distribution. It works fine and all that but it seems that the /etc/init.d/mysql script to start/stop the deamon uses a mysql userid: debian-sys-maint
Problem is that I accidently changed the password for this user. Is there a way to find out the original password so I can put it back?
I found also a file /etc/mysql/debian.cnf in which I see the user and his encrypted password. I googled this a few times but no solutions found so far. Is it even possible to change this password?
I mean, I can change the password in the mysql.user table but there's no script to change it in the debian.cnf file.
I already tried to put the encrypted password from the debian.cnf file directly in the mysql.user table for the debian-sys-maint user but that don't seem to help.

any help welcome.

kind regards.
Lieven

Last edited by ldp; 08-12-2004 at 05:00 AM.
 
Old 08-12-2004, 06:00 AM   #2
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
I found out how to get it working again.
It seems that the password in the /etc/mysql/debian.cnf file is just a plaintext password altough it looks like an encrypted one. (it has the same amount of random characters like all other encrypted passwords in the mysql.user table)
So instead of putting the pwd directly in the table, I used the password() function to encrypt it and now it works fine again.
rgds.
 
1 members found this post helpful.
Old 08-12-2007, 07:31 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Thanks for the tip. I helped me out after I did the same.

jlinkels
 
Old 06-01-2009, 04:12 AM   #4
stioanid
Member
 
Registered: Dec 2008
Location: Athens
Distribution: Centos Ubundu RedHat
Posts: 38

Rep: Reputation: 15
Quote:
Originally Posted by ldp View Post
I found out how to get it working again.
It seems that the password in the /etc/mysql/debian.cnf file is just a plaintext password altough it looks like an encrypted one. (it has the same amount of random characters like all other encrypted passwords in the mysql.user table)
So instead of putting the pwd directly in the table, I used the password() function to encrypt it and now it works fine again.
rgds.
Because I have the same problem with mysql and I can restart it.
Can you please provide the exact command you typed.
What I did is to copy password from /etc/mysql/debian.cnf and had it copied inside the following command

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'password from debian.cnf' WITH GRANT OPTION;

but i think it didn't work because when I run

mysql -u root -p'password from debian.cnf'

I get the following
Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

I can just restart it to try it because it's a production machine and can't go offline.
Last time I try it, it wouldn't start back-up and I had to remove /etc/mysql/my.cnf in order to start it.
 
Old 02-17-2010, 10:36 AM   #5
geodrummer55
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by stioanid View Post
Because I have the same problem with mysql and I can restart it.
Can you please provide the exact command you typed.
What I did is to copy password from /etc/mysql/debian.cnf and had it copied inside the following command

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'password from debian.cnf' WITH GRANT OPTION;

but i think it didn't work because when I run

mysql -u root -p'password from debian.cnf'

I get the following
Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

I can just restart it to try it because it's a production machine and can't go offline.
Last time I try it, it wouldn't start back-up and I had to remove /etc/mysql/my.cnf in order to start it.

If you have PHPMyAdmin installed then you can log in as root, then change the debian-sys-maint users password to the one from the debian.cnf file without having to encrypt it or anything.
 
Old 03-22-2010, 11:54 AM   #6
RedScourge
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 1
You do NOT need to grant all permissions, this is a bad habit to get into from a security standpoint.

All you need to grant is this (as root or whoever):

GRANT SHUTDOWN ON *.* TO 'debian-sys-maint'@'localhost';
GRANT SELECT ON `mysql`.`user` TO 'debian-sys-maint'@'localhost';

Because it needs to shutdown/startup, and does a test select from the users table as a sanity check to ensure the root user exists. This select is usually done by /usr/share/mysql/debian-start.inc.sh which is loaded by /etc/mysql/debian-start
 
1 members found this post helpful.
Old 02-22-2013, 03:57 PM   #7
ckuttruff
LQ Newbie
 
Registered: Dec 2007
Distribution: Slackware 12
Posts: 6

Rep: Reputation: 1
Thanks for the info...

Quote:
Originally Posted by RedScourge View Post
You do NOT need to grant all permissions, this is a bad habit to get into from a security standpoint.

All you need to grant is this (as root or whoever):

GRANT SHUTDOWN ON *.* TO 'debian-sys-maint'@'localhost';
GRANT SELECT ON `mysql`.`user` TO 'debian-sys-maint'@'localhost';

Because it needs to shutdown/startup, and does a test select from the users table as a sanity check to ensure the root user exists. This select is usually done by /usr/share/mysql/debian-start.inc.sh which is loaded by /etc/mysql/debian-start
Appreciate your comment... had an absurdly difficult time finding info about which privileges are really necessary and why for this user.
 
Old 08-29-2014, 04:57 AM   #8
Fwed
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
removed

Last edited by Fwed; 08-29-2014 at 05:07 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox, I changed my default profile for login, how do I change it back ? TroelsSmit Linux - Newbie 5 03-19-2010 07:35 AM
I changed video settings & rebooted, now I cant change it back - black screen ?? wayneh Linux - Newbie 8 12-12-2006 04:35 PM
Big problem changed root password for mysql can't login pls comment johnnydangerous Linux - Software 5 07-08-2005 01:22 AM
chsh accident; big accident. shinystuffrox *BSD 3 06-06-2005 07:06 AM
changed driver to nvidia, can't login to X, need to change driver back to vesa how??? Fear58 Linux - Software 7 12-08-2004 12:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration