Upgrade MySQL on Debian Lenny (Mercury)

Has anyone used the Lenny backports to upgrade from mysql 5.0.51a to 5.1.49?

I think this is what I'd add to my sources.list file:

deb http://backports.debian.org/debian-backports lenny-backports main

deb http://security.debian.org/ lenny/updates contrib

deb-src http://security.debian.org/ lenny/updates contrib

I've updated on another Lenny site, but it isn't using Mercury, so I don't want to toast my new installation.

9 Replies

I don't use mysql, but I have mysql-common 5.1.49-3~bpo50+1 installed on my Debian lenny Linode because it's a dependency of something else.

% apt-cache policy mysql-common
mysql-common:
  Installed: 5.1.49-3~bpo50+1
  Candidate: 5.1.49-3~bpo50+1
  Version table:
     5.1.54-1 0
        200 http://ftp.us.debian.org experimental/main Packages
     5.1.49-3 0
        500 http://ftp.us.debian.org squeeze/main Packages
        500 http://ftp.us.debian.org sid/main Packages
 *** 5.1.49-3~bpo50+1 0
        990 http://backports.debian.org lenny-backports/main Packages
        100 /var/lib/dpkg/status
     5.0.51a-24+lenny4 0
        990 http://ftp.us.debian.org lenny/main Packages
        990 http://security.debian.org lenny/updates/main Packages

Here's part of /etc/apt/sources.list:

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free
deb-src http://backports.debian.org/debian-backports lenny-backports main contrib non-free

And part of /etc/apt/preferences:

% cat /etc/apt/preferences
Package: *
Pin: release a=lenny-backports
Pin-Priority: 990

Package: *
Pin: release n=lenny
Pin-Priority: 900

No backports package will ever be considered "an upgrade" and installed automatically.

Also, 5.0 and 5.1 are separate branches, different Debian packages.

You can easily install it explicitly, tho.

but is this separate branch okay to use with Pressflow you think? if i load up a new version of mysql and it breaks something, can i just remove and go back to the original version?

i'm dealing with a new site and new drupal database right now. so toasting the db and recreating isn't the end of the world.

@theatereleven:

but is this separate branch okay to use with Pressflow you think? if i load up a new version of mysql and it breaks something, can i just remove and go back to the original version?

i'm dealing with a new site and new drupal database right now. so toasting the db and recreating isn't the end of the world.

Yes (I use 5.1 with drupal), and yes, just make sure you back up anything important, and run mysql_upgrade.

cool thanks.

mysql_upgrade? someone else told me to do apt-get upgrade. not arguing…just new. what is the best route to take? also, are there post upgrade tasks that need to be done to the db or anything?

thanks man.

mysql_upgrade is a post install task, it upgrades your database files from the 5.0 format to the 5.1 format. Also I think you'll have to do apt-get install to install 5.1 since I believe it's a separate package.

@theatereleven:

mysql_upgrade? someone else told me to do apt-get upgrade. not arguing…just new. what is the best route to take? also, are there post upgrade tasks that need to be done to the db or anything?
Once you've added the backport lines to your sources.list, do aptitude update, then just run aptitude. Use aptitude's ncurses interface to find the mysql package. For that package, you will see each version APT knows about. Highlight the version you want to install and press +. If there are any dependency problems when you do this, you can press e to examine them, look at possible solutions, and select a solution to apply. Finally, press g to preview the changes, and g again to start the installs and upgrades.

And I believe the debian package's install/upgrade procedure does mysql_upgrade automagically…

Thanks everyone. For any other newbies, here is what I did to upgrade:

1) Edit your sources list in Debian to allow pulling from the Debian backports repository:

nano /etc/apt/sources.list

add the line:

deb http://backports.debian.org/debian-backports lenny-backports main

save the file

2) Get available updates:

apt-get update

3) Upgrade MySQL (no need to stop the server)

apt-get -t lenny-backports install mysql-server-5.1

*the first parts of the command are always used to pull a package. You can then retrieve a package's name from: http://packages.debian.org/search?keywo … -backports">http://packages.debian.org/search?keywords=mysql&searchon=names§ion=all&suite=lenny-backports

4) Add the package information so you get updates:

nano /etc/apt/preferences

Add:

Package: *

Pin: release a=lenny-backports

Pin-Priority: 200

And there you go….hope that helps!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct