nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Starting MySQL problem

This is a discussion on Starting MySQL problem within the Databases servers forums, part of the Mastering Servers category; Hi folks, Ubuntu 7.04 server amd64 MySQL-5.0.38 installed on repo It just comes to my notice that on booting PC ...


Go Back   nixCraft Linux Forum > Mastering Servers > Databases servers

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-23-2008, 07:54 AM
Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 89
Rep Power: 2
satimis is on a distinguished road
Default Starting MySQL problem

Hi folks,


Ubuntu 7.04 server amd64
MySQL-5.0.38 installed on repo


It just comes to my notice that on booting PC a warning displayed on text scrolling indicates MySQL failure to start


$ cat /var/log/syslog | grep mysql
Code:
......
Jun 23 07:18:36 mail mysqld_safe[4758]: started
Jun 23 07:18:36 mail mysqld[4761]: 080623  7:18:36  InnoDB: Started; log sequenc
e number 0 43655
Jun 23 07:18:36 mail mysqld[4761]: 080623  7:18:36 [Note] Recovering after a cra
sh using /var/log/mysql/mysql-bin
Jun 23 07:18:36 mail mysqld[4761]: 080623  7:18:36 [Note] Starting crash recover
y...
Jun 23 07:18:36 mail mysqld[4761]: 080623  7:18:36 [Note] Crash recovery finishe
d.
Jun 23 07:18:36 mail mysqld[4761]: 080623  7:18:36 [Note] /usr/sbin/mysqld: read
y for connections.
Jun 23 07:18:36 mail mysqld[4761]: Version: '5.0.38-Ubuntu_0ubuntu1.4-log'  sock
et: '/var/run/mysqld/mysqld.sock'  port: 3306  Ubuntu 7.04 distribution
Jun 23 07:18:37 mail /etc/mysql/debian-start[4798]: Upgrading MySQL tables if ne
cessary.
Jun 23 07:18:37 mail /etc/mysql/debian-start[4803]: ERROR 1045 (28000): Access d
enied for user 'debian-sys-maint'@'localhost' (using password: YES)
Jun 23 07:18:37 mail /etc/mysql/debian-start[4803]: Error executing ''/usr/bin/m
ysql' '--defaults-extra-file=/var/lib/mysql/mysql_upgrade_defaults' '--force' '-
-no-auto-rehash' '--batch' '--user=debian-sys-maint' '--database=mysql' < '/usr/
share/mysql/mysql_fix_privilege_tables.sql''
Jun 23 07:18:37 mail /etc/mysql/debian-start[4810]: Checking for crashed MySQL t
ables.
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]: WARNING: mysqlcheck has foun
d corrupt tables
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]: /usr/bin/mysqlcheck: Got err
or: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password:
 YES) when trying to connect
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]: 
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]:  Improperly closed tables ar
e also reported if clients are accessing
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]:  the tables *now*. A list of
 current connections is below.
Jun 23 07:18:38 mail /etc/mysql/debian-start[4858]:
I suppose the problem is caused by running several 'apt-get update' and 'apt-get upgrade'. Before MySQL start/stop without problem nor having warning.


On running following commands


$ sudo /etc/init.d/mysql status
Code:
Password:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: Y
ES)'
$ sudo /etc/init.d/mysql stop
Code:
 * Stopping MySQL database server mysqld       [fail]
$ sudo netstat -tap | grep mysql
Code:
tcp        0      0 *:mysql       *:*     LISTEN     4760/mysqld
It seems MySQL is running. Maybe on safe_mode?


$ su
Password:
# mysql -u root -p
Code:
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y
ES)
# mysql -u root
Code:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N
O)
Even I can't login MySQL. Please advise how to fix this problem. TIA


B.R.
satimis
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-23-2008, 11:29 AM
agn agn is offline
Member
User
 
Join Date: Feb 2008
My distro: OpenBSD/FreeBSD/Debian/Fedora/RHEL
Posts: 69
Rep Power: 1
agn is on a distinguished road
Default

Try running 'mysql_upgrade'.
Reply With Quote
  #3 (permalink)  
Old 06-23-2008, 11:50 AM
Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 89
Rep Power: 2
satimis is on a distinguished road
Default

Quote:
Originally Posted by agn View Post
Try running 'mysql_upgrade'.
Hi agn,


Performed following test;


# /etc/init.d/mysql start
Code:
 * Starting MySQL database server mysqld                              [ OK ] 
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
root@mail:/home/satimis# /usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
# /etc/init.d/mysql status
Code:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
 *
# mysql_upgrade
Code:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Error executing ''/usr/bin/mysql' '--defaults-extra-file=/var/lib/mysql/mysql_upgrade_defaults' '--force' '--no-auto-rehash' '--batch' '--user=root' '--database=mysql' < '/usr/share/mysql/mysql_fix_privilege_tables.sql''
# kill `cat /var/run/mysqld/mysqld.pid`
No complaint


# /etc/init.d/mysql status
Code:
 * MySQL is stopped.
$ sudo mysql_upgrade
Code:
Password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Error executing ''/usr/bin/mysql' '--defaults-extra-file=/var/lib/mysql/mysql_upgrade_defaults' '--force' '--no-auto-rehash' '--batch' '--user=root' '--database=mysql' < '/usr/share/mysql/mysql_fix_privilege_tables.sql''
$ sudo locate mysqld.sock
Code:
/var/run/mysqld/mysqld.sock
It is there.


# find / -name mysqld.sock
No printout


Find command can't find mysqld.sock


# ls -la /var/run/mysqld/
Code:
total 0
drwxr-xr-x  2 mysql root  40 2008-06-23 14:25 .
drwxr-xr-x 20 root  root 820 2008-06-23 09:43 ..
# ls -ld /var/run/mysqld/
Code:
drwxr-xr-x 2 mysql root 40 2008-06-23 14:25 /var/run/mysqld/
Having tried almost half day and unable to find a glue.


B.R.
satimis
Reply With Quote
  #4 (permalink)  
Old 06-23-2008, 12:08 PM
agn agn is offline
Member
User
 
Join Date: Feb 2008
My distro: OpenBSD/FreeBSD/Debian/Fedora/RHEL
Posts: 69
Rep Power: 1
agn is on a distinguished road
Default

MySQL is not running. Start mysql with --skip-grant-tables option and try running mysql_upgrade.
Reply With Quote
  #5 (permalink)  
Old 06-23-2008, 02:11 PM
Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 89
Rep Power: 2
satimis is on a distinguished road
Default

Quote:
Originally Posted by agn View Post
MySQL is not running. Start mysql with --skip-grant-tables option and try running mysql_upgrade.
My problem here is unable to start MySQL server. mysqld_safe starts on running;

# /etc/init.d/mysql start


satimis
Reply With Quote
  #6 (permalink)  
Old 06-30-2008, 11:56 AM
agn agn is offline
Member
User
 
Join Date: Feb 2008
My distro: OpenBSD/FreeBSD/Debian/Fedora/RHEL
Posts: 69
Rep Power: 1
agn is on a distinguished road
Default

Code:
# mysqld  --skip-grant-tables
Reply With Quote
  #7 (permalink)  
Old 06-30-2008, 12:59 PM
Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 89
Rep Power: 2
satimis is on a distinguished road
Default

Quote:
Originally Posted by agn View Post
Code:
# mysqld  --skip-grant-tables
Hi agn,


I tried several days and can't fix my problem. I have 2 Ubuntu boxes, 6.06 and 7.04 both LAMP server. Both suffer the same problem after running apt-get upgrade. I tried your suggestion before without a breakthrought. Finally I have to remove all MySQL packages and reinstall them. Now the Ubuntu box 6.06 seems working normally. But I can reinstall MySQL packages on the Ubuntu 7.04 box.


# apt-get install mysql-server mysql-client
Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libmysqlclient15off mysql-client-5.0 mysql-common mysql-server-5.0
Suggested packages:
  tinyca
The following NEW packages will be installed:
  libdbd-mysql-perl libmysqlclient15off mysql-client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/36.5MB of archives.
After unpacking 96.6MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Reading package fields... Done
Reading package status... Done
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
grave bugs of mysql-server-5.0 ( -> 5.0.38-0ubuntu1.4) <done>
 #480292 - CVE-2008-2079: mysql allows local users to bypass certain privilege checks (Fixed: mysql-dfsg-5.0/5.0.51a-7)
Summary:
 mysql-server-5.0(1 bug)
Are you sure you want to install/upgrade the above packages? [Y/n/?/...]  n
****************************************************************************
****** Exit with an error by force in order to stop the installation. ******
****************************************************************************
E: Sub-process if dpkg -s apt-listbugs | grep -q '^Status: .* ok installed'; then /usr/sbin/apt-listbugs apt || ( test $? -ne 10 || exit 10; echo 'Warning: apt-listbugs exited abnormally, hit enter key to continue.' 1>&2 ; read a < /dev/tty ); fi returned an error code (10)
E: Failure running script if dpkg -s apt-listbugs | grep -q '^Status: .* ok installed'; then /usr/sbin/apt-listbugs apt || ( test $? -ne 10 || exit 10; echo 'Warning: apt-listbugs exited abnormally, hit enter key to continue.' 1>&2 ; read a < /dev/tty ); fi
I'm still struggling.


B.R.
satimis
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
problem with System + MySQL backup script massoo Shell scripting 1 08-20-2007 09:50 PM
problem in mysql client lalit Linux software 1 11-29-2006 09:42 PM
problems starting squid for a rank newbie scarletlancer Linux software 1 11-02-2006 04:20 PM
Getting error when starting the database sbhupathireddy Linux software 1 07-06-2006 05:02 PM


All times are GMT +5.5. The time now is 11:19 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36