Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Proper way of updating mysql from 5.0.90-r2 to 5.1.50?
Date: Wed, 01 Sep 2010 21:08:16
Message-Id: 201009012305.05409.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] Proper way of updating mysql from 5.0.90-r2 to 5.1.50? by Mick
1 Apparently, though unproven, at 22:15 on Wednesday 01 September 2010, Mick did
2 opine thusly:
3
4 > 2010/9/1 Aniruddha <mailingdotlist@×××××.com>:
5 > > On Tuesday 31 August 2010 20:30:55 Mick wrote:
6 > >> > But this is apparently not the proper way, because after
7 > >> > restarting the server, apache does not show my web-page
8 > >> > reporting there is no such a database. I checked it with
9 > >> > phpmyadmin, and really, there is absolutely no database
10 > >> > in mysql!
11 > >> >
12 > >> > I quickly restored backup version which I have done just
13 > >> > before trying mysql-update, so my web-site is up and running.
14 > >> > Now I would like to update mysql the right way, I but do not
15 > >> > know how to do it...
16 > >>
17 > >> Hi Jarry,
18 > >>
19 > >> Some years ago I ran into some similar problem, I can't recall exactly
20 > >> what. Lost in folklore (wiki?) were some instructions to first stop
21 > >> mysql before you update it and I have been following them since.
22 > >>
23 > >> I stop apach & mysql, run the update, dispatch-conf and then restart
24 > >> them both. Haven't had problems since.
25 > >>
26 > >> There may be a better way for doing this - in which case others who know
27 > >> better will hopefully chime in.
28 > >
29 > > I'm curious as well. Imo it shouldn't be necessary to stop mysql server
30 > > for each update.
31 >
32 > Actually, this problem may be more sinister ... a bug?
33 >
34 > I also updated to the latest stable and as soon as I tried to restart
35 > apache I got:
36 > =========================================
37 > # /etc/init.d/apache2 start
38 > * apache2 has detected an error in your setup:
39 > apache2: Syntax error on line 155 of /etc/apache2/httpd.conf: Syntax error
40 > on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot load
41 > /usr/lib/apache2/modules/libphp5.so into server: libmysqlclient.so.15:
42 > cannot open shared object file: No such file or directory
43 > =========================================
44 >
45 > What the ... ?
46 >
47 > Line 155 of my /etc/apache2/httpd.conf says:
48 >
49 > Include /etc/apache2/modules.d/*.conf
50 >
51 > Line 4 of /etc/apache2/modules.d/70_mod_php5.conf, says:
52 >
53 > LoadModule php5_module modules/libphp5.so
54 >
55 > Also, I seem to have modules/libphp5.so and is world readable:
56 >
57 > $ ls -la /usr/lib/apache2/modules/libphp5.so
58 > -rw-r--r-- 1 root root 5720576 Aug 13 20:09
59 > /usr/lib/apache2/modules/libphp5.so
60 >
61 >
62 > I am downgrading now before a lynch mob arrives, but has anyone else
63 > run into this problem?
64 >
65 > PS. I'm running www-servers/apache-2.2.16
66
67
68 You got so close to the real answer, just one more step :-)
69
70 $ ldd /usr/lib64/apache2/modules/libphp5.so | grep mysql
71 libmysqlclient_r.so.16 => /usr/lib64/mysql/libmysqlclient_r.so.16
72 (0x00007f185d528000)
73
74 Think this through: you have a complex piece of software with it's config in
75 memory. A library that uses a library uses a library. Then you remove that
76 last library and replace it with version x+1.
77
78 How do you expect the library in the middle of the chain to know about that?
79 Via magic? Voodoo? Some automatic-check-if-stuff-changed-cron-job?
80
81 No, you just simply restart services that use things that changed, especially
82 if they used (then closed) the file you just changed.
83
84 You might also need revdep-rebuild to get everything back 100%. It's all just
85 situation-normal for a source based distro. Nothing you can, or should, try to
86 "fix".
87
88
89 --
90 alan dot mckinnon at gmail dot com