PDA

View Full Version : [SOLVED] 10.04 mysql problem



Kmob810
May 20th, 2010, 05:10 PM
I recently upgraded to 10.04 and have had niggly problems since. When I start up and close down there is a lot of information which briefly flashes on the screen but I don't know how to pause this and find out what its all about. I tried Update Manager and was informed that I needed to run a partial update which I did and then was informed that "mysql-server-5.1 pkg is in a very bad inconsistent state, you should reinstall it before attempting configuration".
Help please! what do I do? how do I reinstall this file? where do I find it?
I am relative newbie and would appreciate simple instructions!!!!!
Thanks :)

Kmob810
May 21st, 2010, 11:20 AM
Can anyone help please? :confused:

sanderd17
May 22nd, 2010, 10:52 AM
Go to System-> administration -> Synaptic and search for the package "mysql-server-5.1"
If you select it, you can chose to completele remove it (including settings) and afterwards install it again if you need it.

In code:


sudo apt-get purge mysql-server-5.1
sudo apt-get install mysql-server-5.1

Kmob810
May 22nd, 2010, 07:31 PM
Thanks for the reply.
I tried the Synaptic route but it freezes on me.
Tried the terminal route with the following result (it also freezes)

kevin@kevin-laptop:~$ sudo apt-get purge mysql-server-5.1
[sudo] password for kevin:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
kevin@kevin-laptop:~$ sudo dpkg --configure -a
dpkg: error processing mysql-server-5.1 (--configure):
Package is in a very bad inconsistent state - you should
reinstall it before attempting configuration.
Errors were encountered while processing:
mysql-server-5.1
kevin@kevin-laptop:~$ sudo apt-get install mysql-server-5.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
tinyca
The following packages will be upgraded:
mysql-server-5.1
1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 0B/7,007kB of archives.
After this operation, 0B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 249437 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12 (using .../mysql-server-5.1_5.1.41-3ubuntu12.1_i386.deb) ...

Kmob810
May 24th, 2010, 12:32 PM
Thanks to both of you who responded but sadly I still have the problem.
I am now thinking of a complete reinstall. I have an iso disk of 10.04 but being not only a newbie but possibly a thicko newbie (I haven't really got into the internals of Linux) I would like to know if I reinstall will I lose everything, my photos, music, applications etc etc? this would be a shame as I have quite a lot of those and also important information on Korganiser as a example. When I used 09.10 I had no problems with drivers, I could use Compiz etc but since the upgrade thru Update Manager I have had serious problems my mysql and drivers.
I am at a loss now as a lot of my programmes won't start e.g. Google Earth plus others.
It looks like a complete reinstall is the answer but can I reinstall directly onto the present installation or do I have to uninstall first?
ANY help, preferably in non Linux language (simple instructions please!) would be greatly appreciated.
This problem is really starting to get on my nerves now, I need to sort it asap or its back to windows, which I don't want to do.
Thanks. :confused:

wojox
May 24th, 2010, 12:36 PM
Try reinstalling it:


sudo dpkg-reconfigure -phigh -a


sudo apt-get install -f

Kmob810
May 24th, 2010, 05:55 PM
Here is the result of the above:

kevin@kevin-laptop:~$ sudo dpkg-reconfigure -phigh -a
[sudo] password for kevin:
This is not dpkg install-info anymore, but GNU install-info
See the man page for ginstall-info for command line arguments
install-info: No dir file specified; try --help for more information.
kevin@kevin-laptop:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
1 not fully installed or removed.
Need to get 0B/7,007kB of archives.
After this operation, 0B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 249437 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12 (using .../mysql-server-5.1_5.1.41-3ubuntu12_i386.deb) ...

at this point it freezes .... again :(

Kmob810
May 25th, 2010, 06:29 PM
as of now I can't open Synaptic Package Manager I receive the following:

Unable to get exclusive lock

This usually means that another package management application (like apt-get or aptitude) is already running. Please close that application first.

Is there anyone who can help with these problems????

:confused::(:confused::(

affert
May 26th, 2010, 02:21 PM
I am having this exact same problem.

Another thing I have tried is



sudo dpkg -r --force-remove-reinstreq mysql-server-5.1
dpkg: warning: overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database ... 197042 files and directories currently installed.)
Removing mysql-server-5.1 ...

However, this freezes on "Removing mysql-server-5.1"

Please help us!

Kmob810
May 27th, 2010, 08:16 AM
Can anyone come up with an answer to this problem which seems to affect a lot of users. Surely someone out there can help!

sanguinoso
May 27th, 2010, 08:48 AM
dpkg --purge mysql-server-5.1

I would try that although I'm not sure it will work if dpkg -r didn't. Give it a try though.

affert
May 27th, 2010, 08:39 PM
dpkg --purge mysql-server-5.1

I would try that although I'm not sure it will work if dpkg -r didn't. Give it a try though.

I gave that a try. It didn't work:



sudo dpkg --purge mysql-server-5.1
[sudo] password for doneill:
dpkg: error processing mysql-server-5.1 (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
mysql-server-5.1


I also tried the purge with --force-all. It froze up at the same place "Removing mysql-server-5.1 ..."

ronparent
May 27th, 2010, 09:24 PM
Since all else seems to be failing, try booting in the recovery mode. That will present you with a menu. Try selecting and running dpkg. With luck that will sync your system with the repositories.

Also have a look at the Lucid Release notes - https://wiki.ubuntu.com/LucidLynx/ReleaseNotes in regards to myswl.

affert
May 28th, 2010, 05:01 AM
I just noticed earlier tonight that I have ubuntu 10.04, but also xubuntu 9.10. With the issue 10.04 has with mysql, I am going to start over. I'm downloading xubuntu 10.04 (fresh release!) and am going to start from scratch. I'm very glad I did my home folder as its own partition, which will make this transition hopefully less painful.

I'll let you know if this takes care of the issue...

iCrusade
May 28th, 2010, 05:08 AM
Same issue since today morning, i am not sure on what is going on.

Today suddenly my mysql-server-5.1 started giving problems and now i can't remove it or install it again. Any attempts to remove via apt-get or Synaptic freeze at "Removing mysql-server-5.1". I have already lost 3 hours trying to reinstall LAMP, and everytime getting stuck at this mysql-server-5.1 removal...

Any help is appreciated.

ccaaee
May 28th, 2010, 08:06 AM
Same problem here... This is getting VERY URGENT ! Any help would be GREATLY appreciated.
Thanks
chris

Kmob810
May 28th, 2010, 08:32 AM
Tried booting in recovery mode but got the same problem : freezing at "the replacing mysql" position.
also when I try to run synaptic I get : E:dpkg was interrupted, you must manually run "sudo dpkg --configure -a" to correct the problem
E:_cache->open() failed

I am getting nowhere with this problem It seems the answer maybe a clean reinstall which is something i don't really want to do.

There has to be an answer to these problems!!!!!!!
:confused:

Kmob810
May 28th, 2010, 08:45 AM
also tried running Synaptic PM in a terminal and got this:
could not lock /var/lib/dpkg/lock -open (11 : resource temporarily unavailable
E: unable to lock the administration directory (/var/lib/dpkg1)- is another process using it?

ccaaee
May 28th, 2010, 10:41 AM
Ok, I reinstalled 10.04 (that's everything) and added mysql which worked.

Now, as I am one who has the data directory not in /var/lib/mysql but on another partition I carried out the appropriate modifications in /etc/mysql/my.cnf and /etc/apparmor.d/usr.sbin.mysqld
then
/etc/init.d/apparmor stop && /etc/init.d/apparmor start
/etc/init.d/mysql restart

And guess what? It's broken again, mysql will not start. I moved things back to their original positions in /var/lib/mysql but to no avail. Also, I cannot seem to get any info in /var/log/* ...

Any Ideas ???

chris

ronparent
May 28th, 2010, 04:55 PM
If you fixed it and it broke again, it is starting to sound like a bug report???

Kmob810
May 29th, 2010, 08:12 AM
isn't there anybody in this big wide world who can answer our question regarding the mysql freezing and how we can fix it?

kevin@kevin-laptop:~$ sudo dpkg-reconfigure -phigh -a
[sudo] password for kevin:
This is not dpkg install-info anymore, but GNU install-info
See the man page for ginstall-info for command line arguments
install-info: No dir file specified; try --help for more information.
kevin@kevin-laptop:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
1 not fully installed or removed.
Need to get 0B/7,007kB of archives.
After this operation, 0B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 249437 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12 (using .../mysql-server-5.1_5.1.41-3ubuntu12_i386.deb) ...

at this point it freezes .... again :confused::confused::confused:

sidzen
May 29th, 2010, 08:51 AM
autonuke HD with dban, try again!

Kmob810
May 29th, 2010, 09:01 AM
Sidzen ???????? what do you mean ???????

Kmob810
June 1st, 2010, 07:59 PM
I've drawn a line under this now as obviously there doesn't seem to be an answer to the problem. I have reinstalled 10.04.
Thanks to those of you who tried to help. :)

Rickshin
June 1st, 2010, 11:20 PM
I had a similar issue where after the update to 10.04, mysql was not allowing to connect to it through a socket. I then tried to uninstall the mysql-server and it hangs. I determined that it was hanging on a function that was trying to stop the server. The solution as follows:


sudo apt-get remove mysql-server #replace mysql-server with your mysql server version
when apt-get hangs (after a few seconds), open a new terminal and type "sudo service mysql start".

tbrinkley
June 4th, 2010, 10:17 PM
I got the same error message when trying to reinstall mysql. It hung when it got to install mysql. This is what worked for me:

ps -aux //gave me the following at the very end

root 22853 0.0 0.0 0 0 pts/3 Z+ 12:32 0:00 [mysql-server-5.] <defunct>
root 22854 0.0 0.0 16332 1180 pts/3 S+ 12:32 0:00 stop mysql

I killed the mysql-server install first, then I killed the stop mysql process, and then they both went away.

lechu502
June 8th, 2010, 02:07 PM
Hey,

I have got similar problem. Mysql 5.1 works ok after clean installation of Ubuntu 10.04. But if I try to change the datadir (I updated both /etc/mysql/my.cnf and /etc/apparmor.d/usr.sbin.mysqld ) mysql won't start again.

What is weird, that mysql worked ok (with altered datadir) when I upgraded Ubuntu 9.10 to 10.04... So it seems to be a problem of updating datadir in Ubuntu 10.04.
Have anyone got an idea how to update datadir correclty? I would like to use my databases stored in /home/services/mysql...

Kind regards,
Leszek

kenfeyl
July 26th, 2010, 04:27 PM
I just got flummoxed with this problem as well. I too had attempted to change my datadir via my.cnf. Here's how I solved it (warning: I'm not sure if all or only some of these steps were necessary).

PROBLEM 1: MySQL won't start again after you've attempted to change the datadir.
SOLUTION 1: Tough luck -- you'll need to wipe out your MySQL install and start over. Here's how to do it without reinstalling all of Ubuntu.

a) Do "sudo apt-get purge mysql-common." Wait for it to get stuck at "Removing mysql-server-5.1."
b) Open up a separate shell and do "ps auxww | grep mysql" and look for the line "stop mysql," identifying its PID. Then do "sudo kill PID" for that PID.
c) Go back to the first shell -- the purge should now have completed.
d) Sadly, the purge doesn't get rid of everything. Do "sudo find /var | grep mysql" and "sudo find /etc | grep mysql." Manually delete everything ("sudo rm -rf FILE") that comes back. This may be overkill -- I'm not sure exactly which file is the culprit. But killing them all did the trick for me.
e) Reboot your machine.
f) Re-install mysql-server ("sudo apt-get install mysql-server").
g) At this point, it should actually complete and you will return to having a working version of MySQL. Whew!

PROBLEM 2: You still want MySQL to use a different datadir.
SOLUTION 2: Sadly, editing datadir never did work for me -- I kept falling into PROBLEM 1. The only solution that worked for me uses symlinks, namely:

a) sudo mv /var/lib/mysql /mnt/mysql
b) sudo chown mysql:mysql /mnt/mysql
c) sudo ln -s /mnt/mysql /var/lib/mysql

Then, with a giant sigh of relief, I had my datadir effectively set up as /mnt/mysql. I can't believe this isn't a more common problem -- pretty much every MySQL application I've done requires a separate mount. Granted, I work with big data, while for the bulk of MySQL applications -- medium-sized Web sites and below -- local storage may be sufficient. Either way, I hope the Ubuntu people will get to the bottom of this by 10.10 so I can abandon this stupid hack.

thorbs
August 4th, 2010, 05:04 PM
Hi I am trying to apply this solution. when I open the seperate shell I get following information:


Root 2348 0.0 0.0 3792 1088 pts/1 s+ 17:57 0:00 stop mysql


what is the pid in that?

phaed
August 6th, 2010, 07:16 AM
2348. I figured it out the first time by just trying to kill all three. :-)