Ugrade breaks MySql


14 posts
by AndyNC » Fri Oct 05, 2012 11:34 am
Hi all,
I've had mysql running for a week or so now but I've just done and sudo apt-get update followed by apt-get upgrade and mysql is now broken.
Code: Select all
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


So the mysql need to be configured but I don't know how to start the configuration.
I've tried another suggestion of changing
bind-address = 127.0.0.1
to
bind-address = 0.0.0.0
and attempting a /etc/init.d/mysql start with no luck.
Can anyone guide me through this.

Many thanks

Andy
Posts: 28
Joined: Thu Aug 30, 2012 7:04 am
by AndyNC » Fri Oct 05, 2012 11:54 am
Me again,
I should add that it's Raspbian. The image is
Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l

I have installed postfix/courier, apache2, php5, MySql server and PHPMyAdmin. These were all woring untill the update.

Here's the full install screen output if it helps:
Code: Select all
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  libmysqlclient18 mysql-client-5.5 mysql-common mysql-server mysql-server-5.5
  mysql-server-core-5.5
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,915 kB of archives.
After this operation, 626 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-common all  5.5.24+dfsg-9 [76.3 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libmysqlclient18  armhf 5.5.24+dfsg-9 [616 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server all  5.5.24+dfsg-9 [74.5 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server-5.5  armhf 5.5.24+dfsg-9 [1,714 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-client-5.5  armhf 5.5.24+dfsg-9 [1,413 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server-core -5.5 armhf 5.5.24+dfsg-9 [3,021 kB]
Fetched 6,915 kB in 11s (594 kB/s)
Preconfiguring packages ...
(Reading database ... 62221 files and directories currently installed.)
Preparing to replace mysql-common 5.5.24+dfsg-8 (using .../mysql-common_5.5.24+d fsg-9_all.deb) ...
Unpacking replacement mysql-common ...
Preparing to replace libmysqlclient18:armhf 5.5.24+dfsg-8 (using .../libmysqlcli ent18_5.5.24+dfsg-9_armhf.deb) ...
Unpacking replacement libmysqlclient18:armhf ...
Preparing to replace mysql-server 5.5.24+dfsg-8 (using .../mysql-server_5.5.24+d fsg-9_all.deb) ...
Unpacking replacement mysql-server ...
Setting up mysql-common (5.5.24+dfsg-9) ...
(Reading database ... 62221 files and directories currently installed.)
Preparing to replace mysql-server-5.5 5.5.24+dfsg-8 (using .../mysql-server-5.5_ 5.5.24+dfsg-9_armhf.deb) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Stopping MySQL database server: mysqld.
Unpacking replacement mysql-server-5.5 ...
Preparing to replace mysql-client-5.5 5.5.24+dfsg-8 (using .../mysql-client-5.5_ 5.5.24+dfsg-9_armhf.deb) ...
Unpacking replacement mysql-client-5.5 ...
Preparing to replace mysql-server-core-5.5 5.5.24+dfsg-8 (using .../mysql-server -core-5.5_5.5.24+dfsg-9_armhf.deb) ...
Unpacking replacement mysql-server-core-5.5 ...
Processing triggers for man-db ...
Setting up libmysqlclient18:armhf (5.5.24+dfsg-9) ...
Setting up mysql-client-5.5 (5.5.24+dfsg-9) ...
Setting up mysql-server-core-5.5 (5.5.24+dfsg-9) ...
Setting up mysql-server-5.5 (5.5.24+dfsg-9) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed !
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


There may be erroneous break in some of the lines because of the width of the remote ssh window I was running from.

I guess any one doing the same will get the same problem so a solution seems to be needed but it's beyond me without a few clues.

Many thanks

Andy

Edit: If there's an easy way to go back using apt-get I'd love to find out.
Posts: 28
Joined: Thu Aug 30, 2012 7:04 am
by AndyNC » Fri Oct 05, 2012 12:14 pm
Hi All,

Did a reboot and seems to work OK.

But should I need to do this or does the package installation script need changing?

Regards
Andy
Posts: 28
Joined: Thu Aug 30, 2012 7:04 am
by AndyNC » Fri Oct 05, 2012 12:30 pm
So I then installed htop and I get the same problem in that at the end of the htop installation mysql fails to restart.

If I reboot mysql server runs. Note that PHPMyAdmin say it's "Server version: 5.5.24-9"

Cheers

Andy
Posts: 28
Joined: Thu Aug 30, 2012 7:04 am
by red6 » Tue Oct 09, 2012 4:42 pm
I am experiencing same problem and am also running 3.2.27+ #160 PREEMPT Mon Sep 17

Here is what happens:

aptget install <anything> always wants to stop and start mysqld but the start fails.

Was not a problem until about a week ago.

Here is the output of a test 'apt-get install':
Code: Select all
sudo apt-get install htop
Reading package lists... Done
Building dependency tree
Reading state information... Done
htop is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up mysql-server-5.5 (5.5.24+dfsg-9) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)



I am investigating but not having much luck.
Posts: 47
Joined: Thu Sep 20, 2012 12:32 am
Location: Toronto, Canada
by bitbitbit » Wed Oct 10, 2012 2:23 am
I'm having the same problem too!!

I tried to install mysql with "sudo apt-get install mysql-server mysql-client php5-mysql"

end up with the same errors.....very much willing to see a solution.... :cry: :cry: :cry: :cry:

Code: Select all
[ ok ] Stopping MySQL database server: mysqld.
121010  2:14:45 [Note] Plugin 'FEDERATED' is disabled.
121010  2:14:45 InnoDB: The InnoDB memory heap is disabled
121010  2:14:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121010  2:14:45 InnoDB: Compressed tables use zlib 1.2.7
121010  2:14:45 InnoDB: Using Linux native AIO
121010  2:14:45 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(135987200 bytes) failed; errno 12
121010  2:14:45 InnoDB: Completed initialization of buffer pool
121010  2:14:45 InnoDB: Fatal error: cannot allocate memory for the buffer pool
121010  2:14:45 [ERROR] Plugin 'InnoDB' init function returned error.
121010  2:14:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121010  2:14:45 [ERROR] Unknown/unsupported storage engine: InnoDB
121010  2:14:45 [ERROR] Aborting

121010  2:14:45 [Note] /usr/sbin/mysqld: Shutdown complete

[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php5-mysql (5.4.4-7) ...

Creating config file /etc/php5/mods-available/mysql.ini with new version

Creating config file /etc/php5/mods-available/mysqli.ini with new version

Creating config file /etc/php5/mods-available/pdo_mysql.ini with new version
Setting up mysql-client (5.5.24+dfsg-9) ...
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libapache2-mod-php5 ...
[ ok ] Reloading web server config: apache2.
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Posts: 30
Joined: Thu Aug 30, 2012 3:18 am
by red6 » Wed Oct 10, 2012 2:44 pm
Your error log is showing the same results as mine. Innodb won't initialize. (The storage engine).
We should see "InnoDB: Completed initialization of buffer pool" but instead get an error.

A reboot is your workaround for now. (You have probably already discovered that :) )

I think this has something to do with the version of MySQL - "5.5.24-9 (Debian)".
Posts: 47
Joined: Thu Sep 20, 2012 12:32 am
Location: Toronto, Canada
by red6 » Wed Oct 10, 2012 3:19 pm
Here is another workaround I found on stackoverflow.com.

After your apt-get install <whatever> blows up mysql, let it complete and then:

service apache2 stop
service apache2 start
service mysqld start

Maybe apache2 is configured to use way too much memory ?
Posts: 47
Joined: Thu Sep 20, 2012 12:32 am
Location: Toronto, Canada
by red6 » Wed Oct 10, 2012 3:32 pm
Here is the problem and the fix. MySQL 5.5 defaults to an Innodb buffer size of 128M. It was 8M.

So add this to /etc/mysql/my.cnf in the section where it mentions Innodb settingss but doesn't actually have any explicit settings:

innodb_buffer_pool_size = 8M

See http://bugs.mysql.com/bug.php?id=63989 for more info.
Posts: 47
Joined: Thu Sep 20, 2012 12:32 am
Location: Toronto, Canada
by bitbitbit » Thu Oct 11, 2012 5:10 am
yes...I can get mysql starting after reboot....

but it seems there are many problems still....

1) after reboot, Pi cannot ask me to login again (though I can login with PUTTY), instead it says....

Code: Select all
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


2) I try to "sudo service mysql stop" however, it returns:
Code: Select all
[FAIL] Stopping MySQL database server: mysqld failed!


Erm.....is anybody experiencing these as well??
Posts: 30
Joined: Thu Aug 30, 2012 3:18 am
by portets » Thu Oct 11, 2012 6:31 am
Possibly related to http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=19334

The firmware is currently a little bit broken.
Posts: 185
Joined: Sat Oct 29, 2011 6:24 am
by bitbitbit » Thu Oct 11, 2012 6:51 am
yay~~solved~it's the problem with the preset password~ :D :D :D

solution link:
http://www.happysysadm.com/2011/01/stop ... ysqld.html
Posts: 30
Joined: Thu Aug 30, 2012 3:18 am
by wiredsource » Thu Apr 11, 2013 1:58 pm
rm /var/lib/mysql/ib*

Solved it for me
Posts: 1
Joined: Thu Apr 11, 2013 1:57 pm
by dimkir » Wed Jan 22, 2014 11:18 am
Well, changing size of the innodb buffer (where it was 128M by default) actually made my mysql server run.

Code: Select all
innodb_buffer_pool_size = 8M



However I still don't understand, why it wouldn't run 128Mb buffer on a Raspberry Pi with 512Mb of RAM?
Posts: 2
Joined: Wed Jan 22, 2014 11:15 am