Mon 23 Mar 2009
Installing MySQL 5.1 on debian and ubuntu using apt
Posted by Kris under Tech
[21] Comments
For debian/ubuntu users who want to use MySQL 5.1, there aren’t really many options available apart from compiling from source.
Whilst this is probably the best solution, a far simpler and easier (no need to worry about things like the client) method is using the repositories from dotdeb.org. Although these are made for debian installs, I tried it earlier on ubuntu 8.10 and it worked without any problems. As usual, back up your data first!
Assuming you’ve got mysql-server-5.0 installed (although if you don’t have the server installed at all it should still work), here are the steps to get 5.1.
First, you need to edit /etc/apt/sources.list and add the dotdeb repository. This is the line you need to add for Lenny, but just change it to Etch if you haven’t upgraded yet (see my earlier post if you want to know how to do that)
deb http://packages.dotdeb.org lenny all
Then, update…
apt-get update
And then install 5.1
apt-get install mysql-server-5.1
This should also install the dependancies: libmysqlclient16, mysql-client-5.1, and update mysql-common. If you already have 5.0 installed, this will also remove the server and client for it.
If you get a message saying that packages can’t be authenticated, it isn’t anything to worry about. Just select ‘y’ and continue. After the install is complete, you should have MySQL 5.1 installed with the most useful engines:
Server version: 5.1.32-0.dotdeb.0 (Debian)
You can also use the dotdeb repositories to upgrade to the latest versions of apache, and php.
It’s probably worth reading this guide on apt pinning, which is the best way to maintain a system using repositories with different versions of the same packages.
21 Responses to “ Installing MySQL 5.1 on debian and ubuntu using apt ”
Trackbacks & Pingbacks:
-
[...] ist. Eine andere Lösung ist einen lenny-backport zu benutzen, ein eigenes MySQL Paket oder ein dotdeb.org Paket. Mit einer neueren MySQL Version kann man dann auch einen größeren key_buffer [...]
-
[...] http://www.monkeedev.co.uk Facebook [...]








So nice man!
I was added the repos and everything works fine!
Best regards!
Great Tip and site references.
Worked perfectly like a charm for me.
Thanks and Best Regards
i’m got error :
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run `apt-get -f install’ to correct these:
The following packages have unmet dependencies:
cpp-4.3: Depends: gcc-4.3-base (= 4.3.2-1ubuntu11) but 4.3.2-1ubuntu12 is to be installed
libgcc1: Depends: gcc-4.3-base (= 4.3.2-1ubuntu11) but 4.3.2-1ubuntu12 is to be installed
libstdc++6: Depends: gcc-4.3-base (= 4.3.2-1ubuntu11) but 4.3.2-1ubuntu12 is to be installed
mysql-server-5.1: Depends: mysql-client-5.1 (>= 5.1.32-0.dotdeb.1) but it is not going to be installed
Depends: libmysqlclient16 (>= 5.1.21-1) but it is not going to be installed
PreDepends: mysql-common (>= 5.1.32-0.dotdeb.1) but 5.0.67-0ubuntu6 is to be installed
Recommends: mailx
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
First I’d try this:
apt-get install -f
Which should satisfy the dependancies which are missing. Also, check that your system is fully up to date. I’ve read some things about it not working perfectly on Ubuntu but I tried it myself (on 8.10) and it worked fine. If you’re using an older version of ubuntu it may be better if you set the dotdeb repository to ‘etch’ rather than ‘lenny’.
Thanks for this, I’ve been looking for ages and tried compiling it myself a few times but couldn’t get it working.
I’m using debian lenny and everything worked perfectly
Good source! I spend full day compiling and configuring Mysql! But this stuff throw my only a lot of bugs and errors! Tanks!
Interesting.
However, you might add that usually, 5.0 cnf files include a “skip-bdb” option. This prevents mysqld from starting in version 5.1.
So if during the mysqld installation process, restart fails and installation aborts, just comment this option in the cnf file and finalize the process with a “apt-get -f install”
Thanks for that tip, Teg. Commenting out the “skip-bdb” option let me bring the daemon back up!
Thanks a lot for the source!!
Now having successfully installed:
Server version 5.1.39-0.dotdeb.0-log
As I read on
http://dev.mysql.com/doc/refman/5.1/en/innodb.html
the InnoDB Plugin is already included into MySQL since Version 5.1.38!
(http://www.innodb.com/products/innodb_plugin/)
Unfortunately I can’t find the plugin in the current installation… do you have any tip how to find it?
The problem is, the manually downloaded InnoDB Plugin works only for MySQL 5.1.37.
So – no included Version and no suitable standalone version…
Grateful for any tip
Best Regards
… solved it like this:
- Get binary Version 5.1.39 from http://www.mysql.com
- Copied plugin files to plugin directory of running mysql
- Added “plugin_dir=/usr/…” in my.cnf
- Followed install instructions on http://www.innodb.com/doc/innodb_plugin-1.0/innodb-plugin-installation.html
cheers
si
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-core-5.1_5.1.47-0.dotdeb.0_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Processing triggers for man-db …
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-core-5.1_5.1.47-0.dotdeb.0_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks for the heads up on how to use the dotdeb with the sources.list. Smooth, seamless. Very nice.Will this work with the 5.0 mysqladmin gui or is there a later version of that?
It works !
It works!!
Thank you
That’s great! Thank’s a lot from Hungary! Good works in the future…
When I try to do the apt-get update I get this error:
W: GPG error: http://packages.dotdeb.org lenny Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY E9C74FEEA2098A6E
Not sure how to fix it. This is a fresh install of Debian.
I see on their website how to install the key.
Alan
Thank you very much
it’s works fine to me
I combine with websites http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-debian-lenny-lamp
I hope there are more advanced development