package mysql-server failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

Bug #153868 reported by The87Boy
206
This bug affects 43 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Won't Fix
Medium
Unassigned
mysql-dfsg-5.1 (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I was just trying to update mysql-server, but it says, that "error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'"

ProblemType: Package
Architecture: i386
Date: Thu Oct 18 13:33:13 2007
DistroRelease: Ubuntu 7.10
ErrorMessage: subprocess new pre-removal script returned error exit status 1
Package: mysql-server-5.0 5.0.45-1ubuntu2
PackageArchitecture: i386
SourcePackage: mysql-dfsg-5.0
Title: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
Uname: Linux lap 2.6.22-14-generic #1 SMP Wed Oct 10 06:00:47 GMT 2007 i686 GNU/Linux

Revision history for this message
The87Boy (lasse-lsmc) wrote :
Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Did you remove the debian-sys-maint user ? This user is needed by the
init script to manage the server.

If so, you can find the relevant account information in
/etc/mysql/debian.cnf.

  status incomplete

Changed in mysql-dfsg-5.0:
status: New → Incomplete
Revision history for this message
The87Boy (lasse-lsmc) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

No, I didn't remove the debian-sys-maint user, so I don't know why

Mathias Gug wrote:
> Did you remove the debian-sys-maint user ? This user is needed by the
> init script to manage the server.
>
> If so, you can find the relevant account information in
> /etc/mysql/debian.cnf.
>
> status incomplete
>
>
> ** Changed in: mysql-dfsg-5.0 (Ubuntu)
> Status: New => Incomplete
>

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

On Thu, Oct 18, 2007 at 04:43:41PM -0000, The87Boy wrote:
> No, I didn't remove the debian-sys-maint user, so I don't know why
>
Could you try connecting to the server using the mysql shell and the
debian-sys-maint credentials ?

--
Mathias

Revision history for this message
The87Boy (lasse-lsmc) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Mathias Gug wrote:
> On Thu, Oct 18, 2007 at 04:43:41PM -0000, The87Boy wrote:
>
>> No, I didn't remove the debian-sys-maint user, so I don't know why
>>
>>
> Could you try connecting to the server using the mysql shell and the
> debian-sys-maint credentials ?
>
What is the MySQL-password I shall use for the debian-sys-maint user

> --
> Mathias
>

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

On Thu, Oct 18, 2007 at 05:14:09PM -0000, The87Boy wrote:
> > Could you try connecting to the server using the mysql shell and the
> > debian-sys-maint credentials ?
> >
> What is the MySQL-password I shall use for the debian-sys-maint user
>

The credentials are stored in /etc/mysql/debian.cnf.

Revision history for this message
The87Boy (lasse-lsmc) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Mathias Gug wrote:
> On Thu, Oct 18, 2007 at 05:14:09PM -0000, The87Boy wrote:
>
>>> Could you try connecting to the server using the mysql shell and the
>>> debian-sys-maint credentials ?
>>>
>>>
>> What is the MySQL-password I shall use for the debian-sys-maint user
>>
>>
>
> The credentials are stored in /etc/mysql/debian.cnf.
>
I get this error:
ERROR 1045 (28000): Access denied for user
'debian-maint-sys'@'localhost' (using password: YES)

Revision history for this message
The87Boy (lasse-lsmc) wrote :

Mathias Gug wrote:
> On Thu, Oct 18, 2007 at 05:14:09PM -0000, The87Boy wrote:
>
>>> Could you try connecting to the server using the mysql shell and the
>>> debian-sys-maint credentials ?
>>>
>>>
>> What is the MySQL-password I shall use for the debian-sys-maint user
>>
>>
>
> The credentials are stored in /etc/mysql/debian.cnf.
>
Oh, of course I meant debian-sys-maint

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

On Fri, Oct 19, 2007 at 07:31:24AM -0000, The87Boy wrote:
> > The credentials are stored in /etc/mysql/debian.cnf.
> >
> Oh, of course I meant debian-sys-maint
>

You should reset the debian-sys-maint password with the one included in
/etc/mysql/debian.cnf.

--
Mathias

Revision history for this message
The87Boy (lasse-lsmc) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Mathias Gug wrote:
> On Fri, Oct 19, 2007 at 07:31:24AM -0000, The87Boy wrote:
>
>>> The credentials are stored in /etc/mysql/debian.cnf.
>>>
>>>
>> Oh, of course I meant debian-sys-maint
>>
>>
>
> You should reset the debian-sys-maint password with the one included in
> /etc/mysql/debian.cnf.
How do I do that?

Revision history for this message
Gareth Cronin (gareth-cronin) wrote : [Solution] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

When I looked at /etc/mysql/debian.cnf, my debian-sys-maint password was C1lO0oEdaJJZrCfZ.
So... I logged into MySQL as the super-user (root in my case) and set the password for debian-sys-maint.

mysql -u root

set password for 'debian-sys-maint'@'localhost'=password('C1lO0oEdaJJZrCfZ');
flush privileges;

That worked.

Revision history for this message
Dianoga (dianoga7) wrote : Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

That fixed it for me.

Revision history for this message
Daniel (daniel-oberski) wrote :

That fixed my month long problem of not being able to updat mysql too, thanks!

Revision history for this message
benita (benitadaniel1986) wrote :

hi,

i have somewat d same problem described above, but more specfically :

i want to install moodle and that requires mysql server.
so i gave:

sudo apt-get install mysql-server

which worked fine. but i cant access it!
i tried:
mysql -u root

it says : access denied,
how do i proceed?
help somebody1

Revision history for this message
Adam Sommer (asommer) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

Hello,

sudo apt-get install mysql-server
>
> which worked fine. but i cant access it!
> i tried:
> mysql -u root
>
> it says : access denied,
>
>
For instructions on setting up MySQL see the MySQL section of the Server
Guide [1]. There is also a community page on Moodle specifically [2]. I'm
not quite sure how accurate it is, because it's been a while since I've
setup Moodle. It should get you going in the right direction though. If
there are any inaccuracies please feel free to edit the page and improve it.

[1] https://help.ubuntu.com/7.10/server/C/mysql.html
[2] https://help.ubuntu.com/community/MySQLMoodle

--
Party On,
Adam

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

On Sat, Feb 02, 2008 at 06:11:42AM -0000, benita wrote:
>
> sudo apt-get install mysql-server
>
> which worked fine. but i cant access it!
> i tried:
> mysql -u root
>

Try:

  mysql -u root -p

The -p option should prompt you for a password, which can be blanked if
you haven't setup one during install.

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Revision history for this message
benita (benitadaniel1986) wrote : Re: [Bug 153868] Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

On Feb 3, 2008 2:07 AM, Mathias Gug <email address hidden> wrote:

> On Sat, Feb 02, 2008 at 06:11:42AM -0000, benita wrote:
> >
> > sudo apt-get install mysql-server
> >
> > which worked fine. but i cant access it!
> > i tried:
> > mysql -u root
> >
>
> Try:
>
> mysql -u root -p
>
> The -p option should prompt you for a password, which can be blanked if
> you haven't setup one during install.
>
> --
> Mathias Gug
> Ubuntu Developer http://www.ubuntu.com
>
> --
> package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade -
> Access denied for user 'debian-sys-maint'@'localhost'
> https://bugs.launchpad.net/bugs/153868
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Source Package "mysql-dfsg-5.0" in Ubuntu: Incomplete
>
> Bug description:
> I was just trying to update mysql-server, but it says, that "error:
> 'Access denied for user 'debian-sys-maint'@'localhost' (using password:
> YES)'"
>
> ProblemType: Package
> Architecture: i386
> Date: Thu Oct 18 13:33:13 2007
> DistroRelease: Ubuntu 7.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> Package: mysql-server-5.0 5.0.45-1ubuntu2
> PackageArchitecture: i386
> SourcePackage: mysql-dfsg-5.0
> Title: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux lap 2.6.22-14-generic #1 SMP Wed Oct 10 06:00:47 GMT 2007
> i686 GNU/Linux
>

hey thanks for replying !
i jus had to give:
mysql -u root -pMyPassword

it worked!

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

Marking triaged. The error message when unable to connect using debian-sys-maint should be improved.

Changed in mysql-dfsg-5.0:
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.0 - 5.0.51-3ubuntu1

---------------
mysql-dfsg-5.0 (5.0.51-3ubuntu1) hardy; urgency=low

  [Mathias Gug]
  * Merge from debian unstable, remaining changes:
    - debian/control:
      - Set Maintainer to Ubuntu Core dev. Move Debian maintainer
        to XSBC-Original-Maintainer.
      - Add mysql-doc-5.0 as a Suggests to mysql-client-5.0, mysql-server-5.0
        and libmysqlclient15-dev.
    - debian/rules: Apply same configuration options on lpia as for i386.
  * debian/control:
    - Preprend XS-Original- to Vcs-{Browser,Svn}.
  * debian/rules:
    - Support DEB_BUILD_OPTIONS option 'nocheck' to skip tests.
  * Dropped patches:
    - debian/patches/91_bug29389.dpatch:
        fix for mysql bug 27383 which causes mysql-test 'mysql_client_test'
        to fail due to gcc 4.x optimizations.
    - debian/libmysqlclient15-dev.files, debian/mysql-client-5.0.files,
      debian/mysql-server-5.0.files: man pages are GPLed now.
  * Improved error message when unable to connect using debian-sys-maint. (LP:
    #153868)

  [Chuck Short]
  * Replcaed --with-comment="Debian" with --with-comment="Ubuntu" in debian/rules (LP: #134384)
  * Added note about the "/etc/mysql/conf.d" directory in my.cnf (LP: #136225)
  * Fixed mysqlhotcopy failure. (LP: #162393)
  * Fixed mysqlslowdump usage. Added patch from Arnold Daniels <email address hidden>. (LP: #183762)

 -- Mathias Gug <email address hidden> Fri, 25 Jan 2008 04:10:49 -0500

Changed in mysql-dfsg-5.0:
status: Triaged → Fix Released
Revision history for this message
Mathias Gug (mathiaz) wrote :

Reopening. This hasn't been fixed and is not trivial.

mysqld init script needs to be modified.

Changed in mysql-dfsg-5.0:
status: Fix Released → Triaged
Revision history for this message
backharlow (bordercolliecult) wrote :

"This bug was fixed in the package mysql-dfsg-5.0 - 5.0.51-3ubuntu1"

The problem persists.

E: /var/cache/apt/archives/mysql-server-5.0_5.0.51a-3ubuntu5.1_i386.deb: subprocess new pre-removal script returned error exit status 1

Revision history for this message
Joseph Slaker (jslaker) wrote :

This bug is still present in Hardy. It's preventing me from completing a software upgrade. Seems to be a pretty critical bug for such a common package.

Revision history for this message
MikeC (ms-clovis) wrote :

This still seems to be a bug in Hardy. I had mysql installed, then removed completely. Then reinstalled. The following errors persist.
E: mysql-server-5.0: subprocess post-installation script returned error exit status 1
E: mysql-server: dependency problems - leaving unconfigured

Revision history for this message
pasQualle (pasqualle-deactivatedaccount) wrote :

Here's the same. I tried to install mysql-server and mysql-client to get a database for amarok.
The terminal says:

 * Stopping MySQL database server mysqld [ OK ]
080707 23:53:53 [ERROR] /usr/sbin/mysqld: unknown variable 'default-charakter-set=utf8'

Reloading AppArmor profiles : done.
 * Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
 subprocess post-installation script returned error exit status 1
Setting up mysql-client (5.0.51a-3ubuntu5.1) ...
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.0; however:
  Package mysql-server-5.0 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Matti Hytonen (matti-hyt) wrote :

Matti Hytonen wrote: I tried upgrade mysql-server
My command: sudo aptitude upgrade

Valmistellaan paketin mysql-server-5.0 5.0.51a-3ubuntu5.1 vaihtamista (käyttäen pakettia .../mysql-server-5.0_5.0.51a-3ubuntu5.3_i386.deb)...
 * Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: varoitus - vanha pre-removal-komentosarja palautti virhetilakoodin 1
dpkg - koitetaan uuden paketin komentosarjaa...
 * Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: virhe käsiteltäessä /var/cache/apt/archives/mysql-server-5.0_5.0.51a-3ubuntu5.3_i386.deb (--unpack):
 aliprosessi uusi pre-removal-komentosarja palautti virhetilakoodin 1
 * Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
 * Starting MySQL database server mysqld [ OK ]
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.0_5.0.51a-3ubuntu5.3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Stopping mysqld failed!

Revision history for this message
Matti Hytonen (matti-hyt) wrote :

Matti Hytonen continuing:
I have xubuntu 8.04.1 Now I found that my problem was in file debian.cnf. There was set user 'debian-sys-maint' and his password. For my system it is a wrong user. I corrected user setting to 'root' and also password.
Now I could upgrade to mysql-server-5.0_5.0..normally
I hope that my system is stable now?

Matti

Revision history for this message
Steve Riddett (tmb-steve) wrote :

I got this bug and was directed here. For the record, I think it occured for me because I had created the database from a complete mysqldump of all databases - *including the mysql database* - from another machine.

So the password for debian-sys-maint would have been set for the other machine rather than the one it was actually running on.

Changing the password as per the instructions above worked for me.

I don't think this is really a distro error.

Revision history for this message
Klaas van Schelven (klaas-vanschelven) wrote :

For the record: same story as Steve Riddtt's for me: mysqldump from seperate machine.

Revision history for this message
Dave Nelson (dave-nelson) wrote :

I had this issue, but it did not concern the debian-sys-maint credentials. In my case I had defined a non-standard socket location in my /etc/mysql/my.cnf, and the socket location in /etc/mysql/debian.cnf was different. Therefore the server could not be stopped nor started during upgrade.

I don't know the significance of "debian.cnf" -- I didn't create it. Where did it come from, and for what is it used? It seems like a fairly fundamental problem that conflicts between these two files could make my entire system un-upgradeable.

Mathias Gug (mathiaz)
summary: - package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade -
- Access denied for user 'debian-sys-maint'@'localhost'
+ package mysql-server failed to install/upgrade - Access denied for user
+ 'debian-sys-maint'@'localhost'
Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
sobi3ch (sobi3ch) wrote :

OVERRIDING PASSWORD WORDED!

mysql -u root

set password for 'debian-sys-maint'@'localhost'=password('C1lO0oEdaJJZrCfZ');
flush privileges;

Revision history for this message
Sebastian Geiger (lanoxx) wrote :

maybe the script could somehow check if the password in /etc/mysql/debian.cnf is still the same as in the mysql database, or if that doesnt work, then try to login as root and prompt the user for a password? After all this bug has been in existance now for two years and keeps surfacing all the time?

Also the pre-removal script could give a more descriptive error such as: login with "debian-sys-maint" failed, check credentials.

Oh, bug #501655 seems to be a duplicate.
Cheers Lanoxx

Revision history for this message
Ju (julianomfferreira) wrote : Re: [Bug 153868] Re: package mysql-server failed to install/upgrade - Access denied for user 'debian-sys-maint'@'localhost'

Lanoxx,

I'm not sure if there's a bug in my situation because when I upgraded to
mysql-server-5.1 the process don't override my /etc/mysql/my.cnf and my
router change my IP to 192.168.1.101 when It has been configured to
192.168.1.100. So after I write in /etc/rc.local the ifconfig 192.168.1.100
 command the problem never happen again!!

Thanks for your help!!

Have a nice weekend!!

On Fri, Feb 12, 2010 at 10:25 AM, LanoxxthShaddow <email address hidden> wrote:

> maybe the script could somehow check if the password in
> /etc/mysql/debian.cnf is still the same as in the mysql database, or if
> that doesnt work, then try to login as root and prompt the user for a
> password? After all this bug has been in existance now for two years and
> keeps surfacing all the time?
>
> Also the pre-removal script could give a more descriptive error such as:
> login with "debian-sys-maint" failed, check credentials.
>
> Oh, bug #501655 seems to be a duplicate.
> Cheers Lanoxx
>
> --
> package mysql-server failed to install/upgrade - Access denied for user
> 'debian-sys-maint'@'localhost'
> https://bugs.launchpad.net/bugs/153868
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.0” package in Ubuntu: Triaged
> Status in “mysql-dfsg-5.1” package in Ubuntu: Triaged
>
> Bug description:
> I was just trying to update mysql-server, but it says, that "error: 'Access
> denied for user 'debian-sys-maint'@'localhost' (using password: YES)'"
>
> ProblemType: Package
> Architecture: i386
> Date: Thu Oct 18 13:33:13 2007
> DistroRelease: Ubuntu 7.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> Package: mysql-server-5.0 5.0.45-1ubuntu2
> PackageArchitecture: i386
> SourcePackage: mysql-dfsg-5.0
> Title: package mysql-server-5.0 5.0.45-1ubuntu2 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux lap 2.6.22-14-generic #1 SMP Wed Oct 10 06:00:47 GMT 2007 i686
> GNU/Linux
>
> To unsubscribe from this bug, go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/153868/+subscribe
>

--
Atenciosamente,
Juliano Maciel Ferreira
Software Developer - E-Programs
(48) 8403-5974 - skype: julianomfferreira

Revision history for this message
Weiss (weiss) wrote :

i create debian-sys-maint user on mysql server with password from /etc/mysql/debian.conf
ITS WORK!

Revision history for this message
programad (programad) wrote :

The overriding password trick fixed it for me.

Thanks.

Revision history for this message
Jarl (jarl-dk) wrote :

FYI: same story as Steve and Klaas for me: mysqldump from seperate machine.

Chuck Short (zulcss)
Changed in mysql-dfsg-5.0 (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.