MySQL 5.6.4 on Ubuntu 11.10
Note: These instructions are for Ubuntu x64 and if you are using 32bit distribution you’ll have to download 32bit packages. Also – there might me newer packages for the software you are installing so check it out before doing this. We will be installing MySQL binary edition.
If you are planning to install latest MySQL server on Ubuntu my recommendation is to first install regular MySQL 5.1. server. Don’t install meta packages, just install essentials and their dependencies. You don’t have to configure MySQL except during installation.
sudo apt-get install mysql-server-5.1 mysql-client-5.1 mysql-client-core-5.1 php5-mysql
If you are using desktop distribution like me and want to have MySQL Workbench go to this page and download “mysql-workbench-gpl-5.2.37-1ubu1104-amd64.deb”. Open it with Debi package manager and install all dependencies. Although I have tried a lot I couldn’t install MySQL Workbench from sources on this version of Ubuntu so this step is essential before upgrading MySQL to v5.6.4.
Next step would be to uninstall MySQL server. Note – you don’t want to “purge” mysql installation because it would remove all dependencies and you don’t want to remove mysql-client because MySQL Workbench need it! So – just open Synaptic Package Manager and only remove mysql-server-5.1 and nothing else.
Now you can download “mysql-5.6.4-m7-linux2.6-x86_64.tar.gz” from this page. Just select “MySQL Community Server” and on next page tab “Development Releases” and you’ll find at the bottom Linux Generic Tar Archive of server. After this you can follow simple steps described below.
sudo su cp /your/download/location/mysql-5.6.4-m7-linux2.6-x86_64.tar.gz /usr/local/mysql.tar.gz cd /usr/local tar zxvf mysql.tar.gz rm mysql.tar.gz ln -s mysql-5.6.4-m7-linux2.6-x86_64 mysql cd mysql chown -R mysql . chgrp -R mysql . scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data rm /etc/mysql/my.cnf cp support-files/my-medium.cnf /etc/mysql/my.cnf cp support-files/mysql.server /etc/init.d/mysql update-rc.d mysql defaults nano /etc/environment # add this to the end of string ":/usr/local/mysql/bin"
It is essential that you reboot your server now. After rebooting open terminal and continue.
sudo su service mysql stop mkdir /var/run/mysqld touch /var/run/mysqld/mysqld.sock chown -R mysql:mysql /var/run/mysqld nano /etc/mysql/my.conf # replace all "/tmp/mysql.sock" with "/var/run/mysqld/mysqld.sock" service mysql start cd /usr/local/mysql/bin mysql_secure_installation # complete installation answering simple questions and securing installation
All that is left now is to test your installation, MySQL Server and Workbench. If you followed all steps you shouldn’t have any problems. I can confirm that this version of MySQL is more advanced, faster and better and I am using it on my production servers.
Category: Administration, Updated February 17, 2012 from admin | Log in
Hello,
I try this on Ubuntu 10.04 LTS.
Process commes to ln -s mysql-5.6.4-m7-linux2.6-x86_64 mysql what makes mysql link in /usr/local directory.
So we cannot cd to them. If we make mysql folder manually here then link mysql-5.6.4-m7-linux2.6-x86_64 appears in it.
But where to take this: scripts/mysql_install_db –user=mysql? ‘no such file or folder’
What do I miss?
You have to follow steps exactly as shown (with some understanding of course), first you have to become root with `sudo su`.
Regarding your problem.
If you have copied tar archive to /usr/local and extracted it you will end up with “mysql-5.6.4-m7-linux2.6-x86_64″ directory like /usr/local/mysql-5.6.4-m7-linux2.6-x86_64.
Now that you are still in /usr/local (check that with `pwd` command) you should be able to make link and cd into mysql linked folder.
When you have cd’ed to mysql folder just write `scripts/mysql_install_db –user=mysql` command, it should execute fine.
Here is my tree for you to see:
├── [root 30] mysql -> mysql-5.6.4-m7-linux2.6-x86_64
│ ├── [root 4.0K] bin
│ ├── [mysql 4.0K] data
│ ├── [root 4.0K] docs
│ ├── [root 4.0K] include
│ ├── [root 4.0K] lib
│ ├── [root 4.0K] man
│ ├── [root 4.0K] mysql-test
│ ├── [root 4.0K] scripts
│ ├── [root 4.0K] share
│ ├── [root 4.0K] sql-bench
│ └── [root 4.0K] support-files
├── [root 4.0K] mysql-5.6.4-m7-linux2.6-x86_64
│ ├── [root 4.0K] bin
│ ├── [mysql 4.0K] data
│ ├── [root 4.0K] docs
│ ├── [root 4.0K] include
│ ├── [root 4.0K] lib
│ ├── [root 4.0K] man
│ ├── [root 4.0K] mysql-test
│ ├── [root 4.0K] scripts
│ ├── [root 4.0K] share
│ ├── [root 4.0K] sql-bench
│ └── [root 4.0K] support-files
Hello the fastest admin I ever seen
and thank you for reply.
Sorry, I have incorrect packages so this makes confusion (deb and rpm) which I downloaded a month before and (I don’t know how) then setup it successfully on 11.10 just to try new collations and microsecond time with DATETIME and few more new options through C-Api, what works well.
Now I’m trying to do the same on 10.04 and this seem’s can be doned but still haven’t ‘solid, clean, instant and fully repeatable’ procedure. Now I have further problems because of few installing and uninstalling of both 5.1 and 5.6.4 versions where I’m not an linux guru.
Finaly, I have new mysql folder in PATH, but when I type mysql -V this appear:
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1
And when I start mysql from terminal with user root and password – this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.4-m7-log MySQL Community Server (GPL)
So I suppose I’m very close now. Any further advice would be appreciated.
Btw, by following your process literally in second code block may be an error?
nano /etc/mysql/my.conf should be nano /etc/mysql/my.cnf? Btw, I edited it with gedit.
Thank you. I use `nano` command line editor.
It is completely ok when you type `mysql -V` to see 5.1 because that is mysql-client-5.1 you left for MySQL Workbench reporting it’s version. That is client – not server.
If you want to see server version:
This is as follows:
mysql> show variables like ‘%version%’;
+————————-+——————————+
| Variable_name | Value |
+————————-+——————————+
| innodb_version | 1.2.4 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.6.4-m7-log |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | linux2.6 |
+————————-+——————————+
7 rows in set (0.00 sec)
Just for additional info, unlike before in my C/C++ programs I MUST now specifiy socket what was not case before when NULL can be an argument. I don’t care for that because programs works well with new 5.6.4 options.
Like: mysql_real_connect(conn, “localhost”, “root”, my_pass, my_db, 3306, “/var/run/mysqld/mysqld.sock”, 0);
Many thanks for your useful info and additional help!
Maybe you can revert to “/tmp/mysql.sock” and restart. This is default location under Linux and then you probably wouldn’t have to specify socket location.
I linked statically to “/lib64/libmysqlclient.so” then specifying socket is needed.
But when I link “–libs -lmysqlclient -lz” then socket string can be NULL and everything works as expected under linux.
According this we can treat all those issues as fully solved.
Howevwer, I have one big related problem, maybe you know how to solve.
I installed 5.6.4 on windows(7). There was a setup program which does all by himself and server is working OK.
But I cannot compile programs there with code::blocks/gcc, as I can on linux.
Any experience or ideas?
You are forgot to cmake & make or make install
We are having ubuntu 11 running in our server , mysql 5.1 is installed in it
Now we need to upgrade mysql 5.1 to 5.6 in ubuntu 11
wether ubuntu 11 will support mysql 5.6 , if yes any drwabacks or loopholes ?
and how we will upgrade mysql 5.1 to 5.6 ?
and what care should bwe taken before upgrading mysql 5.6 and is it required to upgrade ubuntu also?
I haven’t found any drawbacks or loopholes, it works fine on Ubuntu 11 and you don’t have to upgrade the system. Don’t do it if you don’t know what and why you are doing it on production servers; set up virtual machine first and try it. Once you do it – you cannot use official repositories for mysql any more, you cannot do automatic upgrades because it will try to install 5.1 on top of your 5.6. You can follow my or somebody elses instructions – but I’ll have to warn you that you may loose your data and mess up system if you don’t know what you are doing…
Backup your data, turn off automatic updates, when updating system uncheck everything mysql related…
Hi ,
i am planing to uninstall mysql 5.1 & then install mysql 5.6 over it.
but on official website of mysql , it is showng that slave should be updated before master.
but we are having replication from both ends , means master-master replication is configured
So which server to uograde first ?
What approach shuld be followed to upgrade both the servers ?
and whether their will be any problem in tables , replication , indexes of mysql 5.1 , if mysql is upgraded from 5.1 to 5.6