• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / ERROR 1045 (28000): Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)

ERROR 1045 (28000): Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)

If you’ve moved a MySQL installation from one Debian server to another and/or replaced the user logins on your system, you might get the error message "ERROR 1045 (28000): Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)" when attempting to restart MySQL.

Solution

Debian based systems create a user in MySQL called "debian-sys-maint" with a random password. The file the password is stored in as at /etc/mysql/debian.cnf and will look something like this:

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = drlkgijhdrouiglr
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = drlkgijhdrouiglr
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

The solution is to either reset the password for that MySQL user on the local host to what’s currently in the config file, or to copy the password from the config file on the original host to the one on this host.

Note that when copying the password over from the previous host, make sure it gets copied into both password fields in the config file – there are two with identical passwords.

Note also that the password in this file is not hashed in any way – it’s a plain text password.

Check Out These Related posts:

  1. jQuery: show plain text in a password field and then make it a regular password field on focus
  2. Get MySQL status information from the command line
  3. Logging queries with MySQL
  4. How to restore the debian-sys-maint MySQL user

Filed Under: MySql

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap