MySQL: "Access denied for user 'debian-sys-maint' @ 'localhost '"

Source: Internet
Author: User

System Version Information:
# Mysql-V
MySQL ver 14.12 distrib 5.0.32, for PC-Linux-GNU (IMG) using Readline 5.2
# Uname-
Linux auto-at-server 2.6.18-6-686 #1 SMP Tue Jun 17 21:31:27 UTC 2008 i686 GNU/Linux

The following error is reported when you restart MYSQL:
#/Etc/init. d/MySQL restart
* Stopping MySQL database server mysqld [fail]
* 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 )'

Google: "Debian-sys-Maint" is used to start and stop databases and other database maintenance operations (Linux operating system ).
How can I change the password of this device? I checked it for a long time and explained it as follows:
When MySQL is started in Linux, MySQL will be in the/etc/MySQL/Debian. CNF file.
Query the password information of a Debian-sys-Maint user.

The password information in this file is synchronized from MySql in real time, and the problem should be solved. MySQL unexpectedly exited, causing information not to be synchronized.

I did modify the password of the root user before adding it. I may have changed the password by mistake.

The solution is as follows:
1: query the password information of the Debian-sys-Maint user.
# Cat/etc/MySQL/Debian. CNF

# Automatically generated for Debian scripts. Do not touch!
[Client]
Host = localhost
User = Debian-sys-Maint
Password = n4ashup04s1j32x5
Socket =/var/run/mysqld. Sock
[Mysql_upgrade]
User = Debian-sys-Maint
Password = n4ashup04s1j32x5
Socket =/var/run/mysqld. Sock
Basedir =/usr

2: log on to MySQL and change the password.
# Mysql-u root-P <password>

Mysql> grant all privileges on *. * To 'debian-sys-maint' @ 'localhost' identified by 'n4ashup04s1j32x5 ';

3: reboot successful
#/Etc/init. d/MySQL restart
* Stopping MySQL database server mysqld [OK]
* Starting MySQL database server mysqld [OK]

* Checking for login upt, not cleanly closed and upgrade needing tables.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.