-2

Debian woke up in a bad mood. I worked on it until 9pm yesterday using LAMP.
The process that I made yesterday to today was off and on the machine.
When I called today mysql just does not work. Follow all I try to do:

Detail. The /var/mysql.err logs and /var/mysql.log contains no information.

root@soufraz-debian:~# service mysql stop
[FAIL] Stopping MySQL database server: mysqld failed!
root@soufraz-debian:~# service mysql reload
[....] Reloading MySQL database server: mysqld/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
root@soufraz-debian:~# service mysql restart
[FAIL] Stopping MySQL database server: mysqld failed!
[ ok ] Starting MySQL database server: mysqld already running.
root@soufraz-debian:~# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@soufraz-debian:~# mysqladmin -u root password 102030
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
root@soufraz-debian:~# sudo dpkg-reconfigure mysql-server
mysql-server           mysql-server-5.5       mysql-server-core-5.5  
root@soufraz-debian:~# sudo dpkg-reconfigure mysql-server-5.5
[FAIL] Stopping MySQL database server: mysqld failed!
invoke-rc.d: initscript mysql, action "stop" failed.
root@soufraz-debian:~# /etc/init.d/mysql stop
[FAIL] Stopping MySQL database server: mysqld failed!
root@soufraz-debian:~# mysqld_safe --skip-grant-tables &
[1] 8856
root@soufraz-debian:~# 141208 10:49:50 mysqld_safe Logging to syslog.
141208 10:49:50 mysqld_safe A mysqld process already exists
mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[1]+  Exit 1                  mysqld_safe --skip-grant-tables
9
  • I don't see where service mysqld stop actually worked, so the same locked/damaged/confused process appears to still be running. You may need to manually murder that process and hope the db files aren't corrupted. Also... Are you sure that you have drive space left?
    – Hyppy
    Dec 8, 2014 at 14:23
  • My concern is not to lose the database. Cause I have backup. My concern is, what happened? This happens often in debian? Never had this problem without doing anything other distributions. Dec 8, 2014 at 14:28
  • 1
    You can get down and dirty with debugging tools to check the stack on the running process, if you need a deeper root cause analysis.
    – Hyppy
    Dec 8, 2014 at 14:41
  • Ok. In my case, what is the best way to reinstall the mysql-server? Dec 8, 2014 at 14:44
  • 2
    Reinstall? Where did that come from?
    – Hyppy
    Dec 8, 2014 at 14:46

3 Answers 3

2

I fixed. Unintentionally but fixed.
I reinstall mysql with the following procedure below:

sudo apt-get --purge remove mysql-server-5.5
sudo apt-get --reinstall install mysql-server-5.5

After reinstalling everything returned to normal.
And all my database are in perfect condition. Without data loss.

1

As in the comments beneath your post; I do not see where the mysqld service actually halted correctly, and to reiterate, you will need to forcibly kill each existent mysqld process before attempting to restart the service.

Try running ps aux | grep mysql to get the list of running mysql processes and send a kill signal to each using ps kill -9 PID where 'PID' is the process number of each process output from the ps aux | grep mysql command.

Once you have successfully killed all remaining mysql processes, try starting the service once more.

5
  • Here the result. notepad.cc/qutope86 Dec 8, 2014 at 15:19
  • Appears to have killed all the process, but the message is still denied access appearing and I can not log into mysql. Dec 8, 2014 at 15:20
  • There is nothing in that log detailing that all mysql processes have been killed - can you post the output of ps aux | grep mysql after having stopped the daemon and killed the child processes as above please?
    – BE77Y
    Dec 8, 2014 at 15:31
  • After the kill: # ps aux | grep mysql root 13886 0.0 0.0 7836 884 pts/0 S+ 16:25 0:00 grep mysql Dec 8, 2014 at 19:25
  • The syslog: notepad.cc/lemtema77 Dec 8, 2014 at 19:28
-2

Hi there could be couple of things why its failing, go through a check list. Hope this was helpful

1 Anonymous user ''@'localhost' or ''@'127.0.0.1' https://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw

2 Causes of Access-Denied Errors, on MYSQL site http://dev.mysql.com/doc/refman/5.1/en/access-denied.html

3 Could be an issue with corruption of your mysql database

4 Make a right decision

Not the answer you're looking for? Browse other questions tagged .