cloudnine
By:
cloudnine

How do I upgrade MySQL to the latest version?

July 26, 2014 3.2k views

Hi,

I followed this tutorial to set up Apache, MySQL and PHP:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6

However, that installed MySQL 5.1 and not the latest version.

Is there a way to upgrade the MySQL on my droplet to the latest version?

Thanks.

4 Answers

5.1 is the latest I see available from any of the usual yum repositories. If you want anything newer, you'll have to build it yourself or find a repository hosting it.

You can upgrade MySQL by installing the Remi repo:

sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

and then installing the new MySQL package:

sudo yum --enablerepo=remi install mysql mysql-server

I upgraded using this tutorial on DO:
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-5-6-from-official-yum-repositories

After installing, I typed in the following but MySQL wouldn't start:

service mysqld start

I even upgraded the droplet to 1 GB thinking that the newer mysql server version might require more RAM, but it doesn't work.

Any help would be appreciated. There is no sudo in the command as I had escalated to su -

by Morgan Tocker
In October 2013, the MySQL development team officially launched support for yum repositories. This means that you can now ensure that you have the latest and greatest version of MySQL installed directly from the source! In this guide we will install MySQL 5.6 on a fresh installation of Centos 6, and then apply a couple of extra touches to optimize configuration for DigitalOcean.

@ Kamal, this is a bit late, but if you chance across this thread, here's the output of the mysqld.log file:

140731 22:11:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-07-31 22:11:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documen$
2014-07-31 22:11:59 17699 [Note] Plugin 'FEDERATED' is disabled.
2014-07-31 22:11:59 17699 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-31 22:11:59 17699 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-31 22:11:59 17699 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-31 22:11:59 17699 [Note] InnoDB: Memory barrier is not used
2014-07-31 22:11:59 17699 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-31 22:11:59 17699 [Note] InnoDB: Using Linux native AIO
2014-07-31 22:11:59 17699 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-31 22:11:59 17699 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(136019968 bytes) failed; errno 12
2014-07-31 22:11:59 17699 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2014-07-31 22:11:59 17699 [ERROR] Plugin 'InnoDB' init function returned error.
2014-07-31 22:11:59 17699 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-07-31 22:11:59 17699 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-07-31 22:11:59 17699 [ERROR] Aborting

2014-07-31 22:11:59 17699 [Note] Binlog end
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'partition'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'ARCHIVE'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_METRICS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-07-31 22:11:59 17699 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'

Any pointers on how to proceed?

Thanks in advance.

  • InnoDB: Cannot allocate memory for the buffer pool

    There's the error. It looks like MySQL needs more memory to run. Try adding a swap file:

    How To Add Swap on CentOS 6.

    by Etel Sverdlov
    Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on CentOS 6
Have another answer? Share your knowledge.