Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just installed Ubuntu 12.10 (amd64), and want to install a recent version of MySQL 5.6.

If possible, I would like to install (not upgrade) it the "Debian Way' (i.e., using apt-get or dpkg).

share|improve this question

8 Answers 8

up vote 14 down vote accepted

For older releases like 12.10:

(This release is End of Lifed, consider upgrading!)

I have prepared PPA with MySQL 5.6 packages based on MySQL 5.5 Debian packages. No guarantee that it will work right away, but I would be grateful if you can try it and report back success (or failure).

There are PPAs for MySQL 5.5 and MySQL 5.6, both with latest upstream source.

MySQL 5.5: https://launchpad.net/~ondrej/+archive/mysql-5.5

MySQL 5.6: https://launchpad.net/~ondrej/+archive/mysql-5.6

Update: The MySQL 5.6 packages failed on clean install and that has been fixed. If you find more errors please contact me directly via launchpad, or on https://github.com/oerdnj/deb.sury.org/issues

share|improve this answer
1  
I wonder why the -1? Are those packages non-functional, or there's some other reason? –  oerdnj Jun 25 '13 at 7:24
    
Thanks for the effort! Why is it "experimental"? Will you be maintaining it with future versions/bugfixes? Do you have a (or know of a trustworthy) PPA for PHP 5.5 for 12.04 too? –  Dexter Jul 30 '13 at 13:44
1  
@Dexter It's experimental, because it needs testing. I already maintain php5.5 repository in php5-experimental PPA (soon to be moved to php5 PPA). –  oerdnj Jul 30 '13 at 13:48
1  
@Dexter JFTR I have now merged the two MySQL PPAs into the one. The ppa:ondrej/php5 has been updates with PHP 5.5 as well and PHP 5.4 can be found in ppa:ondrej/php5-oldstable. –  oerdnj Jul 30 '13 at 14:40
1  
@oerdnj: thanks for packaging 5.6 up, but it didn't work for me on a fresh install of raring. Relevant syslog entries are here: gist.github.com/rasa/6161973 –  Ross Smith II Aug 6 '13 at 4:22

you can download the latest .deb file at oracle.com

oracle dev download site

and simply run the command

dpkg -i mysql-5.6.7-rc-debian6.0-x86_64.deb

I didn't install it though, so i can't promise the expected result.

share|improve this answer
    
Stephan, thanks for your help! Unfortunately, I already tried that. It installed ok, but it installed in /opt, and didn't set up anything in /etc, or /etc/init.d, or let me start it with service, or add /opt/mysql/server-5.6/bin to the path, or anything else. –  Ross Smith II Oct 20 '12 at 4:50
    
@Ross, try installing MySQL 5.5 first, using apt-get and then install the .deb file over it. –  Old Pro Oct 24 '12 at 4:41
    
@OldPro: I don't think that will work, as 5.5 will install in /etc, /usr/bin, etc, and 5.6 will install in opt. –  Ross Smith II Oct 24 '12 at 15:20
    
Well so they install in /opt ... Since "the Debian way" is actually just about being a lazy administrator I would live with it and adjust the startup files in /etc/init.d accordingly. Maybe there are even some ready to symlink startup files in /opt. –  Paul Hänsch Oct 27 '12 at 22:25
    
An alternative download site here: ftp.nchu.edu.tw/Unix/Database/MySQL/Downloads/MySQL-5.6 –  worldsayshi Mar 25 '13 at 9:40

You can of course install everything required for Mysql-5.5 from the repositories in both 12.04 and 12.10, but the following should help you get Mysql-5.6 installed.

Firstly, I should try installing the deb file from the official site in Software Centre or Gdebi, as those programs resolve dependencies, dpkg doesn't.


Compiling mysql is your next option:

Note: Doing it the 'Debian way' (as you mention) will only get you mysql-5.5 and not 5.6: i.e.

sudo apt-get source mysql-5.5

as there isn't any other source available by default. If you want to use the latest development code you have to download it from the official site, which is better than trying to enable some unstable repository or another.

There are also no ppas available at the present time (other than the one you have tried), so the following way of compiling mysql-5.6 is actually the easiest and only way at the minute of getting what you want.


However, as you say you are interested in compiling the latest development version of mysql 5.6, the following instructions should help you:

Download the latest development source code from the mysql site and verify the download. At the present time you want mysql-5.6.7-rc.tar.gz; go down the page, select development releases and then select source code in the box.

Now, run

tar xzvf mysql-5.6.7-rc.tar.gz

cd to the folder and create a folder called bld:

cd mysql-5.6.7-rc
mkdir bld
cd bld

At this point it is important to fetch the dependencies with

sudo apt-get install build-essential cmake libaio-dev

Important documentation is available here on the build process, but what you probably want to do is just use the standard options that the official build uses. For that, as noted here, please run (while in the bld folder):

cmake -DBUILD_CONFIG=mysql_release .. 

Then when the cmake configure has finished and is satisfied (take note of any missing dependencies it mentions; if there are any missing ones download them and then delete everything in the bld directory and run the above cmake command again)

Now you are ready to run the compile with make and any options that you may add:

make

When the compile has finished (it will take about an hour), run either

sudo make install or sudo checkinstall

Now, you should have a mysql installation. Any further information should be available in the very detailed official guide.

share|improve this answer
    
Mik, I really appreciate your answer, but I'm looking for how to do it using the standard Debian method. But thanks! –  Ross Smith II Oct 23 '12 at 21:27
    
@RossSmithII see my edit re how doing it the 'Debian way' won't get you the latest version of mysql-5.6. –  user76204 Oct 23 '12 at 22:45
1  
Your answer, while very helpful, and informative, does not truly answer the question, as installing from source, the "Debian Way", uses apt-get source -b or dpkg-buildpackage. –  Ross Smith II Oct 24 '12 at 16:12
    
Thanks.. Your solution works... –  Shashi Feb 22 '13 at 8:22

My SQL 5.6 is available for download here : My SQL 5.6 Download

I think you will have to go with the non - rpm package at the very bottom of the list.

And here you may find details on how to install this version : How to install using binary package

Hope this helps :)

To install and use a MySQL binary distribution, the basic command sequence looks like this:

shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data

Next command is optional

shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &

Next command is optional

shell> cp support-files/mysql.server /etc/init.d/mysql.server
share|improve this answer
    
This answer is a duplicate of askubuntu.com/a/203335/98419, and my response was: ... I already tried that. It installed ok, but it installed in /opt, and didn't set up anything in /etc, or /etc/init.d, or let me start it with service, or add /opt/mysql/server-5.6/bin to the path, or anything else. –  Ross Smith II Oct 31 '12 at 20:10
    
To install MySQL,the basic command sequence looks like this: shell> groupadd mysql shell> useradd -r -g mysql mysql shell> cd /usr/local shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R mysql shell> chgrp -R mysql shell> scripts/mysql_install_db --user=mysql shell> chown -R root shell> chown -R mysql data # Next cmd optional shell> cp support-files/my-medium.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql & # Next cmd optional shell> cp support-files/mysql.server /etc/init.d/mysql.server –  Vikash Singh Nov 1 '12 at 4:20
    
Detailed Description available in the Above mentioned Link :How to install using binary package –  Vikash Singh Nov 1 '12 at 4:21
    
Thanks for your follow up. Unfortunately, I'm not asking how to install MySQL 5.6 by hand. This has been documented in numerous places. I'm asking how to install MySQL 5.6 using the standard Debian methods, either the binaries (preferred) or via source. –  Ross Smith II Nov 2 '12 at 21:58

Here you have all the instructions to install it from binaries, plus the steps to install it in /usr/bin and configure as service as you asked for...

Mysql 5.6 installation

share|improve this answer
2  
Thank you for this link, but it unfortunately, these instruction are for installing the binary manually. the question is how to install mysql using the standard Debian methods, such as apt-get. –  Ross Smith II Feb 11 '13 at 20:37

I have just written a blogpost that covers this topic. Find it at Mysql 5.6 installation. Hope this will help you!

share|improve this answer
    
Awesome, thanks a lot, Eric. –  Evgeny Goldin Jan 3 at 16:09
    
Thanks Eric, a couple things: your comment link is broken on that page also if you need to use the mysql client5.5 with the mysql server 5.6 you need to link the my.cnf to /etc/mysql/my.cnf from /etc/my.cnf –  JD Schmidt Jan 16 at 6:08

Here is another approach compared to empi89 's answer, using a modified mysql init script. Yes this is manual, but this is the price you pay to be on the bleeding edge. Oracle does not provide a repository. Have a look at this post.

EDIT: In brief, you can copy the original /etc/init.d/mysql to /etc/init.d/mysql-opt and modify it as appropriate:

  1. Replace /etc/mysql/my.cnf with /etc/mysql/my-opt.cnf
  2. Replace calls to mysql binaries with the opt ones (e.g. /usr/bin/mysqld_safe to /opt/mysql/server-5.6/bin/mysqld_safe)
  3. Replace the call to /etc/mysql/debian-start with /etc/mysql/debian-start-opt

Then, copy /etc/mysql/debian-start to /etc/mysql/debian-start-opt and edit as appropriate:

  1. Replace calls to mysql binaries with the opt ones (e.g. /usr/bin/mysqld_safe to /opt/mysql/server-5.6/bin/mysqld_safe)
  2. Make it executable

    # chmod a+x /etc/mysql/debian-start-opt
    

Then, copy /etc/mysql/my.cnf to /etc/mysql/my-opt.cnf and edit:

  1. Under the section [mysqld_safe], add the following line:

     mysqld = mysqld --defaults-file=/etc/mysql/my-opt.cnf
    
  2. Under the section [mysqld], modify the following lines:

     basedir = /opt/mysql/server-5.6
     lc-messages-dir = /opt/mysql/server-5.6/share
    
  3. Also if you have this enabled, like I did

     log_slow_queries = <log>
    

    which now is deprecated, it should be replaced by the following two lines:

     slow-query-log = TRUE
     slow-query-log-file = <log>
    

Time for testing Stop mysql

# /etc/init.d/mysql stop

Keep a data backup just in case you will need to revert the old data

# cp -rp /var/lib/mysql /var/lib/mysql.old

Make init script executable

# chmod a+x /etc/init.d/mysql-opt

Test mysql-opt starts.

NOTE: This will update you current mysql internal tables. You did make the data backup, didn’t you ?

# /etc/init.d/mysql-opt start

Check the logs for errors. During debuging a server that doesn’t start you can manually issue

# /opt/mysql/server-5.6/bin/mysqld_safe --defaults-file=/etc/mysql/my-opt.cnf

If everything went ok, you can enable the opt mysql server during startup. Disable the old script from running at init.

# update-rc.d -f mysql remove

Install the new, ignoring the warnings.

# update-rc.d mysql-opt defaults

Verify it is installed.

# ls -l /etc/rc3.d | grep mysql

The previous command should now output something like:

lrwxrwxrwx 1 root root 19 May 10 15:55 S17mysql-opt -> ../init.d/mysql-opt
share|improve this answer

For 14.04 users:

Ubuntu 14.04 defaults to MySQL 5.5, but also has MySQL 5.6 available for installation from the universe archive. Installing 5.6 is as easy as specifying the version:

myuser@mypc:~$ sudo apt-get purge mysql-server-5.5 mysql-client-5.5
myuser@mypc:~$ sudo apt-get autoremove
myuser@mypc:~$ sudo apt-get install mysql-server-5.6 mysql-client-5.6

Check the Tocker's site for more details

share|improve this answer
1  
Should not use PURGE. keep the config on running servers. just modify the config files! link –  TD_Nijboer Jul 10 at 14:19

protected by Community Jun 18 '13 at 11:54

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.