FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-02-2010, 05:10 AM
kashani
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On 9/1/2010 1:00 PM, Aniruddha wrote:

On Tuesday 31 August 2010 20:30:55 Mick wrote:

But this is apparently not the proper way, because after
restarting the server, apache does not show my web-page
reporting there is no such a database. I checked it with
phpmyadmin, and really, there is absolutely no database
in mysql!

I quickly restored backup version which I have done just
before trying mysql-update, so my web-site is up and running.
Now I would like to update mysql the right way, I but do not
know how to do it...


Hi Jarry,

Some years ago I ran into some similar problem, I can't recall exactly
what. Lost in folklore (wiki?) were some instructions to first stop mysql
before you update it and I have been following them since.

I stop apach& mysql, run the update, dispatch-conf and then restart them
both. Haven't had problems since.

There may be a better way for doing this - in which case others who know
better will hopefully chime in.


I'm curious as well. Imo it shouldn't be necessary to stop mysql server for
each update.



I did in place upgrades from 5.0.12 or so on up to 5.0.77 or so. You're
unlikely to have problems upgrading Mysql within 5.0.x. If you're moving
up to 5.1, I would definitely stop inserts into Mysql, dump mysql, stop
mysql, make a copy of /var/lib/mysql just in case, then upgrade to 5.1.
Mysql should be able to upgrade your database in place, but it might
not. If mysql-update doesn't work, importing a dumb is the most reliable
way to get your data into 5.1.
As other people have pointed out you'll need to revdep-rebuild or
preserve the older client libs.


kashani
 
Old 09-02-2010, 09:55 AM
Dale
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

Mick wrote:

On Wednesday 01 September 2010 22:25:39 Tanstaafl wrote:


On 2010-09-01 5:18 PM, Alex Schuster<wonko@wonkology.org> wrote:


I think it's not an urgent problem when this happens. With portage
2.2 and the preserve-libs FEATURE,


You are assuming everyone runs unstable portage??


I'm running vanilla here, so will run revdep-rebuild when I get a minute.
Until then I downgraded, because I was being shouted at ... O_O



I added "=dev-db/mysql-5.1.50-r1" to package.keywords and everything
compiled cleanly. Roach report here.


http://bugs.gentoo.org/show_bug.cgi?id=335615

Hope that helps.

Dale

:-) :-)
 
Old 09-02-2010, 06:09 PM
Mick
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On Thursday 02 September 2010 10:55:03 Dale wrote:
> Mick wrote:
> > On Wednesday 01 September 2010 22:25:39 Tanstaafl wrote:
> >> On 2010-09-01 5:18 PM, Alex Schuster<wonko@wonkology.org> wrote:
> >>> I think it's not an urgent problem when this happens. With portage
> >>> 2.2 and the preserve-libs FEATURE,
> >>
> >> You are assuming everyone runs unstable portage??
> >
> > I'm running vanilla here, so will run revdep-rebuild when I get a minute.
> > Until then I downgraded, because I was being shouted at ... O_O
>
> I added "=dev-db/mysql-5.1.50-r1" to package.keywords and everything
> compiled cleanly. Roach report here.
>
> http://bugs.gentoo.org/show_bug.cgi?id=335615
>
> Hope that helps.

Thanks Dale!

:-)

--
Regards,
Mick
 
Old 09-02-2010, 06:12 PM
Mick
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On Thursday 02 September 2010 06:10:05 kashani wrote:
> On 9/1/2010 1:00 PM, Aniruddha wrote:
> > On Tuesday 31 August 2010 20:30:55 Mick wrote:
> >>> But this is apparently not the proper way, because after
> >>> restarting the server, apache does not show my web-page
> >>> reporting there is no such a database. I checked it with
> >>> phpmyadmin, and really, there is absolutely no database
> >>> in mysql!
> >>>
> >>> I quickly restored backup version which I have done just
> >>> before trying mysql-update, so my web-site is up and running.
> >>> Now I would like to update mysql the right way, I but do not
> >>> know how to do it...
> >>
> >> Hi Jarry,
> >>
> >> Some years ago I ran into some similar problem, I can't recall exactly
> >> what. Lost in folklore (wiki?) were some instructions to first stop
> >> mysql before you update it and I have been following them since.
> >>
> >> I stop apach& mysql, run the update, dispatch-conf and then restart
> >> them both. Haven't had problems since.
> >>
> >> There may be a better way for doing this - in which case others who know
> >> better will hopefully chime in.
> >
> > I'm curious as well. Imo it shouldn't be necessary to stop mysql server
> > for each update.
>
> I did in place upgrades from 5.0.12 or so on up to 5.0.77 or so. You're
> unlikely to have problems upgrading Mysql within 5.0.x. If you're moving
> up to 5.1, I would definitely stop inserts into Mysql,

How do you stop inserts? Would this also apply to MyISAMs or only InnoDB?

> dump mysql, stop
> mysql, make a copy of /var/lib/mysql just in case, then upgrade to 5.1.
> Mysql should be able to upgrade your database in place, but it might
> not. If mysql-update doesn't work, importing a dumb is the most reliable
> way to get your data into 5.1.
> As other people have pointed out you'll need to revdep-rebuild or
> preserve the older client libs.
>
> kashani

--
Regards,
Mick
 
Old 09-03-2010, 03:40 AM
kashani
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On 9/2/2010 11:12 AM, Mick wrote:

On Thursday 02 September 2010 06:10:05 kashani wrote:

On 9/1/2010 1:00 PM, Aniruddha wrote:

On Tuesday 31 August 2010 20:30:55 Mick wrote:

But this is apparently not the proper way, because after
restarting the server, apache does not show my web-page
reporting there is no such a database. I checked it with
phpmyadmin, and really, there is absolutely no database
in mysql!

I quickly restored backup version which I have done just
before trying mysql-update, so my web-site is up and running.
Now I would like to update mysql the right way, I but do not
know how to do it...


Hi Jarry,

Some years ago I ran into some similar problem, I can't recall exactly
what. Lost in folklore (wiki?) were some instructions to first stop
mysql before you update it and I have been following them since.

I stop apach& mysql, run the update, dispatch-conf and then restart
them both. Haven't had problems since.

There may be a better way for doing this - in which case others who know
better will hopefully chime in.


I'm curious as well. Imo it shouldn't be necessary to stop mysql server
for each update.


I did in place upgrades from 5.0.12 or so on up to 5.0.77 or so. You're
unlikely to have problems upgrading Mysql within 5.0.x. If you're moving
up to 5.1, I would definitely stop inserts into Mysql,


How do you stop inserts? Would this also apply to MyISAMs or only InnoDB?


Depends on what you can get away with on your system. Applies to both
MyISAM and Innodb though generally it's easier to dump myisam tables.


1. restart Mysql with no network, dump, update, restart with network.
This of course assumes you have no local clients but you can chmod 600
the mysql.sock as well. I've done it this way in the past, but it's not
terribly fancy. Works well in environment where you're not exactly sure
what's writing to your db.


2. mysql -u root then FLUSH TABLES WITH READ LOCK while you're holding
that connection open, mysqldump. I feel like I'm forgetting something
here, but I think it is this simple.


3. Make a slave. Update it, test, all that fun stuff. Point to it, then
update the master which is a slave of the slave. Works well, pretty
easy, but you need to be comfortable with setting up replication.


4. LVM snapshots, still need to lock the tables, but usually it's fast.
Good write up here.

http://www.mysqlperformanceblog.com/2006/08/21/using-lvm-for-mysql-backup-and-replication-setup/

5. Don't bother with a backup. shut down mysql, rsync -av
/var/lib/mysql/ var/lib/mysql.orig/ , upgrade, start mysql. If it
doesn't work shut down mysql and move the old dir back into place.


couple more links
http://dev.mysql.com/doc/refman/5.1/en/backup-policy.html
http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html

kashani
 
Old 09-04-2010, 05:53 AM
Jarry
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On 31. 8. 2010 20:30, Mick wrote:


I stop apach& mysql, run the update, dispatch-conf and then restart them
both. Haven't had problems since.


I tried it that way:

/etc/init.d/apache2 stop
/etc/init.d/mysql stop
emerge --ask --update --deep --newuse world
emerge --depclean
revdep-rebuild
/etc/init.d/mysql start
/etc/init.d/apache2 start

Still the same: databases are gone, mysql is empty. Only users
are there. This is strange: how can updating mysql from one stable
version to higher stable cause complete loss of databases???

Jarry

--
__________________________________________________ _____________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
 
Old 09-04-2010, 09:43 PM
kashani
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On 9/3/2010 10:53 PM, Jarry wrote:

On 31. 8. 2010 20:30, Mick wrote:


I stop apach& mysql, run the update, dispatch-conf and then restart them
both. Haven't had problems since.


I tried it that way:

/etc/init.d/apache2 stop
/etc/init.d/mysql stop
emerge --ask --update --deep --newuse world
emerge --depclean
revdep-rebuild
/etc/init.d/mysql start
/etc/init.d/apache2 start

Still the same: databases are gone, mysql is empty. Only users
are there. This is strange: how can updating mysql from one stable
version to higher stable cause complete loss of databases???

Jarry



IIRC the default my.cnf changed for the worse in Gentoo's 5.1.x ebuild.
Try making a copy of your original my.cnf and put it into place once
you've upgraded. Else you may need to modify the mysql home and data
paths in the new my.cnf to reflect where the database are actually
installed.


kashani
 
Old 09-04-2010, 10:30 PM
Mick
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On Saturday 04 September 2010 22:43:01 kashani wrote:
> On 9/3/2010 10:53 PM, Jarry wrote:
> > On 31. 8. 2010 20:30, Mick wrote:
> >> I stop apach& mysql, run the update, dispatch-conf and then restart them
> >> both. Haven't had problems since.
> >
> > I tried it that way:
> >
> > /etc/init.d/apache2 stop
> > /etc/init.d/mysql stop
> > emerge --ask --update --deep --newuse world
> > emerge --depclean
> > revdep-rebuild
> > /etc/init.d/mysql start
> > /etc/init.d/apache2 start
> >
> > Still the same: databases are gone, mysql is empty. Only users
> > are there. This is strange: how can updating mysql from one stable
> > version to higher stable cause complete loss of databases???
> >
> > Jarry
>
> IIRC the default my.cnf changed for the worse in Gentoo's 5.1.x ebuild.
> Try making a copy of your original my.cnf and put it into place once
> you've upgraded. Else you may need to modify the mysql home and data
> paths in the new my.cnf to reflect where the database are actually
> installed.

I just updated to mysql-5.1.50-r1 on a x86 box, ran revdep-rebuild which
amidst others rebuilt apache and php and all is good now. dispatch-conf
updated only a couple of lines on the config file.

The default paths were not affected on any of the 5 mysql databases I'm
running currently.
--
Regards,
Mick
 
Old 09-05-2010, 09:29 AM
Mick
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On Saturday 04 September 2010 23:30:55 you wrote:
> On Saturday 04 September 2010 22:43:01 kashani wrote:
> > On 9/3/2010 10:53 PM, Jarry wrote:
> > > On 31. 8. 2010 20:30, Mick wrote:
> > >> I stop apach& mysql, run the update, dispatch-conf and then restart
> > >> them both. Haven't had problems since.
> > >
> > > I tried it that way:
> > >
> > > /etc/init.d/apache2 stop
> > > /etc/init.d/mysql stop
> > > emerge --ask --update --deep --newuse world
> > > emerge --depclean
> > > revdep-rebuild
> > > /etc/init.d/mysql start
> > > /etc/init.d/apache2 start
> > >
> > > Still the same: databases are gone, mysql is empty. Only users
> > > are there. This is strange: how can updating mysql from one stable
> > > version to higher stable cause complete loss of databases???
> > >
> > > Jarry
> >
> > IIRC the default my.cnf changed for the worse in Gentoo's 5.1.x ebuild.
> > Try making a copy of your original my.cnf and put it into place once
> > you've upgraded. Else you may need to modify the mysql home and data
> > paths in the new my.cnf to reflect where the database are actually
> > installed.
>
> I just updated to mysql-5.1.50-r1 on a x86 box, ran revdep-rebuild which
> amidst others rebuilt apache and php and all is good now. dispatch-conf
> updated only a couple of lines on the config file.
>
> The default paths were not affected on any of the 5 mysql databases I'm
> running currently.

Oops! I spake too soon! :-(

I cannot access two databases. Both have #mysql50# infront of the name of the
original database. What does this mean? How do I fix it? Other databases
are fine, their names appearing without this strange prefix.
--
Regards,
Mick
 
Old 09-05-2010, 10:08 AM
Mick
 
Default Proper way of updating mysql from 5.0.90-r2 to 5.1.50?

On Sunday 05 September 2010 10:29:29 you wrote:
> On Saturday 04 September 2010 23:30:55 you wrote:
> > On Saturday 04 September 2010 22:43:01 kashani wrote:
> > > On 9/3/2010 10:53 PM, Jarry wrote:
> > > > On 31. 8. 2010 20:30, Mick wrote:
> > > >> I stop apach& mysql, run the update, dispatch-conf and then restart
> > > >> them both. Haven't had problems since.
> > > >
> > > > I tried it that way:
> > > >
> > > > /etc/init.d/apache2 stop
> > > > /etc/init.d/mysql stop
> > > > emerge --ask --update --deep --newuse world
> > > > emerge --depclean
> > > > revdep-rebuild
> > > > /etc/init.d/mysql start
> > > > /etc/init.d/apache2 start
> > > >
> > > > Still the same: databases are gone, mysql is empty. Only users
> > > > are there. This is strange: how can updating mysql from one stable
> > > > version to higher stable cause complete loss of databases???
> > > >
> > > > Jarry
> > >
> > > IIRC the default my.cnf changed for the worse in Gentoo's 5.1.x ebuild.
> > > Try making a copy of your original my.cnf and put it into place once
> > > you've upgraded. Else you may need to modify the mysql home and data
> > > paths in the new my.cnf to reflect where the database are actually
> > > installed.
> >
> > I just updated to mysql-5.1.50-r1 on a x86 box, ran revdep-rebuild which
> > amidst others rebuilt apache and php and all is good now. dispatch-conf
> > updated only a couple of lines on the config file.
> >
> > The default paths were not affected on any of the 5 mysql databases I'm
> > running currently.
>
> Oops! I spake too soon! :-(
>
> I cannot access two databases. Both have #mysql50# infront of the name of
> the original database. What does this mean? How do I fix it? Other
> databases are fine, their names appearing without this strange prefix.

I found the solution:

mysql > ALTER DATABASE `#mysql50#dbname` UPGRADE DATA DIRECTORY NAME;

as described here:

http://mattiasgeniar.be/2010/08/07/mysql-upgrade-to-5-1-database-name-prefix-
mysql50/

I am not sure if this is related with the problem that the O/P had -
disappearing databases. The symptoms when the database with the new prefix is
used to drive a CMS, was an error by apache saying that the database does not
exist. Of course, it does exist but its name now has a funny prefix.

Running mysql -u root -p and SHOW DATABASES; led me to finding out that the
name had changed. BTW, /var/lib/mysql still showed the non-prefixed db names.

Anyway, the above link was very helpful in resolving my problem.
--
Regards,
Mick
 

Thread Tools




All times are GMT. The time now is 07:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org