Thread: MySQL problem
View Single Post
  #5  
Old 25th June 2008, 07:11
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default Problem SOLVED

Quote:
Originally Posted by falko View Post
I think you should set a new password for the debian-sys-maint user in the mysql.user table and then put that password in /etc/mysql/debian.cnf.
Hi falko,


My problem is unable to login MySQL. The strange thing is both Ubuntu boxes now suffering the same problem. At boot MySQL starts at safe mode.

Performed following tests;

Test-1
====


On Xterm-1

# ps ax | grep -i mysql
Code:
 4605 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe
 4647 ?        Sl     0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
 4648 ?        S      0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
 5490 pts/1    R+     0:00 grep -i mysql

# kill `cat /var/run/mysqld/mysqld.pid`
No printout

# netstat -tap | grep mysql
# netstat -tap | grep mysqld
both with out printout

# mysqld_safe --no-defaults
Code:
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[7557]: started
(it hangs here waiting for input)
UPDATE mysql.user SET Password='abcde' WHERE User='debian-sys-maint';
FLUSH PRIVILEGES;
It just hangs there waiting for input.


Start another Xterm.


On Xterm-2

# netstat -tap | grep mysql
Code:
tcp        0      0 *:mysql                 *:*                     LISTEN     9669/mysqld
MySQL is running supposed on safe_mode


# kill `cat /var/run/mysqld/mysqld.pid`
Code:
cat: /var/run/mysqld/mysqld.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

# kill `cat /var/lib/mysql/mail.satimis.com.pid`
No complaint


On Xterm-1

It starts to display;
Code:
STOPPING server from pid file /var/lib/mysql/mail.satimis.com.pid
mysqld_safe[9738]: ended
# UPDATE mysql.user SET Password='abcde' WHERE User='debian-sys-maint';
bash: UPDATE: command not found
# FLUSH PRIVILEGES;
bash: FLUSH: command not found


Test-2
====

On Xterm-1

# nano /home/satimis/mysql-init
copying follow lines on it;
Code:
UPDATE mysql.user SET Password='abcde' WHERE User='debian-sys-maint';
FLUSH PRIVILEGES;

# mysqld_safe --init-file=/home/satimis/mysql-init
Code:
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[10101]: started
(it just hanging here)

On Xterm-2
=======

# netstat -tap | grep mysql
Code:
tcp        0      0 *:mysql                 *:*                     LISTEN     10103/mysqld

# kill `cat /var/run/mysqld/mysqld.pid`
No complaint


On Xterm-1

It starts to display
Code:
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[10155]: ended

Problem still remain.


Also tried
Code:
UPDATE mysql.user SET Password='abcde' WHERE User='debian-sys-maint@localhost';
FLUSH PRIVILEGES;
Without result.


Edit-1:

Bug #153221 in mysql-dfsg-5.0 (Ubuntu)
Bug #153221, first reported on 2007-10-16 by Emil Oppeln-Bronikowski
MySQL server fails to upgrade in Gutsy - debian-sys-maint user permission denied
https://bugs.launchpad.net/ubuntu/+s....0/+bug/153221


Edit-2;

* * * PROBLEM SOLVED * * *


# kill `cat /var/run/mysqld/mysqld.pid`
No complaint


# mysqld_safe --skip-grant-tables &
Code:
[1] 5647
root@mail:/home/satimis# Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[5686]: started
mysql -uroot mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.38-Ubuntu_0ubuntu1.4-log Ubuntu 7.04 distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> UPDATE user SET password=PASSWORD('abcde') WHERE user='debian-sys-maint';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

# nano /etc/mysql/debian.cnf
Changing the passwords


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

# /etc/init.d/mysql restart
Code:
 * Stopping MySQL database server mysqld                                                                         
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[5742]: ended
                                                                                                          [ OK ]
 * Starting MySQL database server mysqld                                                                  [ OK ] 
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
[1]+  Done                    mysqld_safe --skip-grant-tables

# /etc/init.d/mysql status
Code:
 * /usr/bin/mysqladmin  Ver 8.41 Distrib 5.0.38, for pc-linux-gnu on x86_64
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version          5.0.38-Ubuntu_0ubuntu1.4-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 35 sec

Threads: 1  Questions: 136  Slow queries: 0  Opens: 132  Flush tables: 1  Open tables: 17  Queries per second avg
: 3.886

# ps ax | grep -i mysql
Code:
 5788 pts/1    S      0:00 /bin/sh /usr/bin/mysqld_safe
 5827 pts/1    Sl     0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/
run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
 5828 pts/1    S      0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
 5904 pts/1    S+     0:00 grep -i mysql

# /etc/init.d/mysql stop
Code:
 * Stopping MySQL database server mysqld          [ OK ]

# /etc/init.d/mysql start
Code:
 * Starting MySQL database server mysqld             [ OK ] 
 * Checking for corrupt, not cleanly closed and upgrade needing tables.

Problem solved NOW.


I'll fix another Ubuntu box later. IIf there is any problem i'll come back.

Thanks


satimis

Last edited by satimis; 25th June 2008 at 08:29. Reason: typing correction
Reply With Quote