I have an issue after I upgrade MYSQL from 5.5 to 5.6 cause I want security update.
I using Vesta CP on my droplet to hold 3 Wordpress websites.

My droplet:
Ubuntu 14.04.4 x32
Memory 512 MB
Disk 20 GB

2016-10-06 15:49:07 5080 [Note] Plugin 'FEDERATED' is disabled.
2016-10-06 15:49:07 5080 [ERROR] Function 'innodb' already exists
2016-10-06 15:49:07 5080 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2016-10-06 15:49:07 5080 [ERROR] Function 'federated' already exists
2016-10-06 15:49:07 5080 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2016-10-06 15:49:07 5080 [ERROR] Function 'blackhole' already exists
2016-10-06 15:49:07 5080 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2016-10-06 15:49:07 5080 [ERROR] Function 'archive' already exists
2016-10-06 15:49:07 5080 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2016-10-06 15:49:07 5080 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-06 15:49:07 5080 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-06 15:49:07 5080 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-06 15:49:07 5080 [Note] InnoDB: Memory barrier is not used
2016-10-06 15:49:07 5080 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-06 15:49:07 5080 [Note] InnoDB: Using Linux native AIO
2016-10-06 15:49:07 5080 [Note] InnoDB: Not using CPU crc32 instructions
2016-10-06 15:49:07 5080 [Note] InnoDB: Initializing buffer pool, size = 20.0M
2016-10-06 15:49:07 5080 [Note] InnoDB: Completed initialization of buffer pool
2016-10-06 15:49:07 5080 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-06 15:49:07 5080 [Note] InnoDB: The log sequence numbers 114578589 and 114578589 in ibdata files do not match the log sequence number 115317197 in the ib_logfiles!
2016-10-06 15:49:07 5080 [Note] InnoDB: Database was not shutdown normally!
2016-10-06 15:49:07 5080 [Note] InnoDB: Starting crash recovery.
2016-10-06 15:49:07 5080 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-10-06 15:49:07 5080 [Note] InnoDB: Restoring possible half-written data pages
2016-10-06 15:49:07 5080 [Note] InnoDB: from the doublewrite buffer...
2016-10-06 15:49:07 5080 [Note] InnoDB: 128 rollback segment(s) are active.
2016-10-06 15:49:07 5080 [Note] InnoDB: Waiting for purge to start
2016-10-06 15:49:08 5080 [Note] InnoDB: 5.6.33 started; log sequence number 115317197
2016-10-06 15:49:08 5080 [Note] Server hostname (bind-address): '*'; port: 3306
2016-10-06 15:49:08 5080 [Note] IPv6 is available.
2016-10-06 15:49:08 5080 [Note]   - '::' resolves to '::';
2016-10-06 15:49:08 5080 [Note] Server socket created on IP: '::'.
2016-10-06 15:49:08 5080 [Note] Event Scheduler: Loaded 0 events
2016-10-06 15:49:08 5080 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.33-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)

How I should do to fix this issue ?
It happen many times after the server do cron job to backup.
Thanks :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hello, all

The key error here is:

InnoDB: Fatal error: cannot allocate memory for the buffer pool

This crash is due to your system running out of memory. I’d suggest that you add a swap file to give yourself a bit more of a buffer. Check out this tutorial:

How To Add Swap on Ubuntu 14.04

What you can also do is to use the MySQLTuner script.

The MySQLTuner is a script written in Perl and allows you to quickly test your MySQL configuration and it gives you suggestions for adjustments to increase performance and stability.

According to the official GitHub page, it supports 300 indicators for MySQL/MariaDB/Percona Server in this last version.

To run the script you could do the following:

  • SSH to your Droplet
  • Download the script:
wget http://mysqltuner.pl/ -O mysqltuner.pl
  • Then execute it:
perl mysqltuner.pl

The script would run multiple checks against your MySQL instance, all checks done by MySQLTuner are documented here.

Also as stated in the official documentation, it is still extremely important for you to fully understand each change you make to a MySQL database server. If you don’t understand portions of the script’s output, or if you don’t understand the recommendations, you should consult a knowledgeable DBA or system administrator that you trust.

As a good practice make sure to always test your changes on staging environments before implementing them on your production database.

On the same note, if you want to have a worry-free MySQL hosting and focus on your application, I would recommend trying out the DigitalOcean Managed Databases:

https://www.digitalocean.com/products/managed-databases-mysql/

This was mini tutorial was posted from @bobbyiliev in this question in our community: https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability

Hope that this helps!
Regards,
Alex

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.

After I config my.conf from https://github.com/serghey-rodin/vesta/blob/master/install/ubuntu/14.04/mysql/my-small.cnf

I got this error.

2016-10-06 16:22:08 6739 [Note] Plugin 'FEDERATED' is disabled.
2016-10-06 16:22:08 6739 [ERROR] Function 'innodb' already exists
2016-10-06 16:22:08 6739 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2016-10-06 16:22:08 6739 [ERROR] Function 'federated' already exists
2016-10-06 16:22:08 6739 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2016-10-06 16:22:08 6739 [ERROR] Function 'blackhole' already exists
2016-10-06 16:22:08 6739 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2016-10-06 16:22:08 6739 [ERROR] Function 'archive' already exists
2016-10-06 16:22:08 6739 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2016-10-06 16:22:08 6739 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-06 16:22:08 6739 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-06 16:22:08 6739 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-06 16:22:08 6739 [Note] InnoDB: Memory barrier is not used
2016-10-06 16:22:08 6739 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-06 16:22:08 6739 [Note] InnoDB: Using Linux native AIO
2016-10-06 16:22:08 6739 [Note] InnoDB: Not using CPU crc32 instructions
2016-10-06 16:22:08 6739 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(136019968 bytes) failed; errno 12
2016-10-06 16:22:08 6739 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2016-10-06 16:22:08 6739 [ERROR] Plugin 'InnoDB' init function returned error.
2016-10-06 16:22:08 6739 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-10-06 16:22:08 6739 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-10-06 16:22:08 6739 [ERROR] Aborting

2016-10-06 16:22:08 6739 [Note] Binlog end
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'partition'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_METRICS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_CMP'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'INNODB_TRX'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'ARCHIVE'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'BLACKHOLE'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'MyISAM'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'CSV'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'MEMORY'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'MRG_MYISAM'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'sha256_password'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'mysql_old_password'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'mysql_native_password'
2016-10-06 16:22:08 6739 [Note] Shutting down plugin 'binlog'
2016-10-06 16:22:08 6739 [Note] /usr/sbin/mysqld: Shutdown complete
Submit an Answer